@bakery-framework/orm 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -0
- package/README.md +88 -0
- package/package.json +59 -0
- package/src/adapters/base.ts +1128 -0
- package/src/adapters/mysql.ts +619 -0
- package/src/adapters/observe.ts +261 -0
- package/src/adapters/pgsql.ts +611 -0
- package/src/adapters/registry.ts +204 -0
- package/src/adapters/sqlite.ts +588 -0
- package/src/adapters.ts +72 -0
- package/src/backup.ts +37 -0
- package/src/connection.ts +69 -0
- package/src/define.ts +380 -0
- package/src/field.ts +595 -0
- package/src/globals.d.ts +22 -0
- package/src/index.ts +63 -0
- package/src/orm/index.ts +24 -0
- package/src/orm/mutation.ts +692 -0
- package/src/orm/query.ts +1680 -0
- package/src/pool.ts +83 -0
- package/src/schema-registry.ts +75 -0
- package/src/schema-util.ts +467 -0
- package/src/sync/builder.ts +618 -0
- package/src/sync/engine.ts +399 -0
- package/src/sync/helpers.ts +1119 -0
- package/src/sync/history.ts +169 -0
- package/src/sync/index.ts +113 -0
- package/src/sync/ledger.ts +335 -0
- package/src/sync/load.ts +368 -0
- package/src/sync/rollback.ts +200 -0
- package/src/sync/types.ts +101 -0
- package/src/sync/view-sql.ts +160 -0
- package/templates/schema.example.ts +94 -0
package/src/orm/index.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **Import order is load-bearing here, and alphabetical order is wrong.**
|
|
3
|
+
*
|
|
4
|
+
* `query.ts` and `mutation.ts` are a cycle: `query.ts` ends with
|
|
5
|
+
* `export const Insert = Mutation.Insert`, read at module top level, and
|
|
6
|
+
* `mutation.ts` imports `DB` from `query.ts`. Whichever this barrel names first
|
|
7
|
+
* is the one that evaluates first.
|
|
8
|
+
*
|
|
9
|
+
* `./query` first works. `./mutation` first does not: `mutation.ts` pulls in
|
|
10
|
+
* `query.ts`, whose top-level `Mutation.Insert` runs while `Mutation` is still
|
|
11
|
+
* initialising, and the whole ORM dies with
|
|
12
|
+
* `TypeError: undefined is not an object (evaluating 'Mutation.Insert')`.
|
|
13
|
+
*
|
|
14
|
+
* Biome's `organizeImports` sorts these alphabetically and puts `./mutation`
|
|
15
|
+
* first. That happened during the 2026-08-09 sweep and cost 12 tests; the
|
|
16
|
+
* compiler cannot see it, because the types are fine either way. Hence the
|
|
17
|
+
* suppression.
|
|
18
|
+
*/
|
|
19
|
+
// biome-ignore-all assist/source/organizeImports: cycle — see above
|
|
20
|
+
import { DB } from './query'
|
|
21
|
+
import { Mutation } from './mutation'
|
|
22
|
+
|
|
23
|
+
export default DB
|
|
24
|
+
export { DB, Mutation }
|