@rebasepro/server-postgres 0.12.1-canary.gdd7172e → 0.12.1-canary.ge191fb7

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebasepro/server-postgres",
3
3
  "type": "module",
4
- "version": "0.12.1-canary.gdd7172e",
4
+ "version": "0.12.1-canary.ge191fb7",
5
5
  "description": "PostgreSQL data source backend implementation for Rebase with Drizzle ORM",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/rebaseco"
@@ -47,11 +47,11 @@
47
47
  "execa": "^9.6.1",
48
48
  "pg": "^8.22.0",
49
49
  "ws": "^8.21.1",
50
- "@rebasepro/common": "0.12.1-canary.gdd7172e",
51
- "@rebasepro/server": "0.12.1-canary.gdd7172e",
52
- "@rebasepro/types": "0.12.1-canary.gdd7172e",
53
- "@rebasepro/utils": "0.12.1-canary.gdd7172e",
54
- "@rebasepro/codegen": "0.12.1-canary.gdd7172e"
50
+ "@rebasepro/common": "0.12.1-canary.ge191fb7",
51
+ "@rebasepro/codegen": "0.12.1-canary.ge191fb7",
52
+ "@rebasepro/server": "0.12.1-canary.ge191fb7",
53
+ "@rebasepro/types": "0.12.1-canary.ge191fb7",
54
+ "@rebasepro/utils": "0.12.1-canary.ge191fb7"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@hono/node-server": "^2.0.12",
@@ -137,6 +137,25 @@ const getDrizzleColumn = (propName: string, prop: Property, collection: Collecti
137
137
  let baseType = (numProp.validation?.integer || isId) ? `integer("${colName}")` : `numeric("${colName}")`;
138
138
  if (numProp.columnType) {
139
139
  if (numProp.columnType === "double precision") baseType = `doublePrecision("${colName}")`;
140
+ // `bigint` and `bigserial` are the only pg-core builders that
141
+ // *require* a config argument: without `mode`, drizzle cannot
142
+ // know whether to hand back a `number` or a `bigint`, and the
143
+ // emitted call does not typecheck.
144
+ //
145
+ // This is why `schema.generated.ts` drifted. Regenerating it
146
+ // produced a file that would not compile, so the bigint lines
147
+ // were hand-patched — and every regeneration after that looked
148
+ // like a large, alarming diff nobody wanted to ship. The file
149
+ // then sat stale for long enough that a security fix to two RLS
150
+ // policies never reached production.
151
+ //
152
+ // `number` rather than `bigint`: these are counters and byte
153
+ // totals that every caller already treats as numbers, and
154
+ // switching the runtime type would be a breaking change to
155
+ // every consumer of the generated schema.
156
+ else if (numProp.columnType === "bigint" || numProp.columnType === "bigserial") {
157
+ baseType = `${numProp.columnType}("${colName}", { mode: "number" })`;
158
+ }
140
159
  else baseType = `${numProp.columnType}("${colName}")`;
141
160
  }
142
161