Repository navigation
Expand file tree
/
Copy pathdatabase.ts
More file actions
109 lines (108 loc) · 2.51 KB
/
Copy pathdatabase.ts
File metadata and controls
109 lines (108 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// @maple-dev/effect-orm/database
//
// Runs compiled statements through a `SqlClient` you provide, and wraps them in
// transactions: Effect's own `withTransaction` plus isolation settings, typed
// COMMIT and ROLLBACK failures, contention retry, and `requireTransaction` for
// helpers that must be atomic. See docs/database.md. `layerTest` is a
// `Database` with no server, for unit tests; see docs/testing.md.
export {
Database,
Transaction,
afterCommit,
execute,
fromSqlClient,
isContention,
layerSqlClient,
query,
requireTransaction,
retryContention,
run,
runNonEmpty,
runOne,
runOption,
stream,
transaction,
type DatabaseApi,
type RowOf,
type RowSchema,
type Runnable,
type StatementInput,
type FromSqlClientOptions,
type RetryOptions,
type Statement,
type TransactionInfo,
type TransactionOptions,
} from "./database/database"
export { constraintViolation, refineConstraints } from "./database/constraint"
export {
CheckViolation,
DatabaseError,
ResultCardinalityError,
ForeignKeyViolation,
NotNullViolation,
UniqueViolation,
InvalidCursor,
TenantScopeViolation,
TransactionClosed,
TransactionCommitFailed,
TransactionOptionsRejected,
TransactionRollbackFailed,
TransactionUnsupported,
type ConstraintViolation,
type TransactionError,
} from "./database/errors"
export {
makeRepository,
type Repository,
type RepositoryError,
type RepositoryOf,
type RepositoryOptions,
type TenantRepository,
} from "./database/repository"
export {
paginate,
type KeysetColumn,
type KeysetDirection,
type KeysetOrder,
type Page,
type PaginateOptions,
} from "./database/paginate"
export {
defineRelations,
findMany,
related,
type CountOf,
type FindManyOptions,
type FindManyRow,
type KeyColumn,
type Relation,
type RelationalSchema,
type RelationalTable,
type RelationBuilder,
type RelationFilter,
type RelationOptions,
type RelationsConfig,
type RelationTables,
type RelationWhere,
type Related,
type WithOf,
} from "./database/relations"
export { QuerySummary, withQuerySummary, type StatementObservation } from "./database/tracing"
export {
TestDatabase,
layerTest,
type TestDatabaseApi,
type TestDatabaseOptions,
type TestReply,
type TestStatement,
} from "./database/test-layer"
export {
findAllBy,
findById,
type FindAllBy,
type FindById,
type LookupError,
type LookupOptions,
} from "./database/resolver"
export { sql, type SqlIdentifier, type SqlRawText, type SqlTemplate } from "./database/sql"
export type { DialectTransactions, IsolationLevel, TransactionSettings } from "./ch/dialect"