@typesql/postgres 0.2.9 → 0.2.10
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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/type-map.d.ts +1 -1
- package/dist/type-map.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +12 -6
- package/src/type-map.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @typesql/postgres
|
|
2
2
|
|
|
3
|
+
## 0.2.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Breaking: TypeSQL is split into a dialect-neutral core and a PostgreSQL dialect. `@typesql/core` keeps what dialects share (`createSql`, queries, fragments, executors, row keys, transactions, migrations, the schema markers `Col`, `Nullable`, `Generated`, `View`, … and the type cache) and adds a dialect contract. PostgreSQL moves to `@typesql/core/postgres`: create a `sql` with `createSql<DB>(postgres, executor?)`, import `Json`, `PgCatalog`, `migrations()`, type maps and the function catalog from `@typesql/core/postgres` (which also re-exports the schema markers), and the engine types from `@typesql/core/postgres/engine` (was `@typesql/core/engine`). The Kysely, Drizzle and Prisma packages take the dialect the same way and read the schema from the client's type: `createSql(postgres, db)` (`createSql<DB>(postgres, db)` still picks a schema explicitly). `typesql introspect` and the Prisma generator import the column helpers from `@typesql/core/postgres` by default.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- @typesql/core@0.8.0
|
|
11
|
+
|
|
3
12
|
## 0.2.9
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ await sql.transaction(async (tx) => {
|
|
|
26
26
|
|
|
27
27
|
If your connection parses `int8` to `bigint` (`types: { bigint: postgres.BigInt }`), pass `{ bigint: true }` as the second argument of `createSql`.
|
|
28
28
|
|
|
29
|
-
[Open an example in the TypeScript Playground](https://www.typescriptlang.org/play/#code/
|
|
29
|
+
[Open an example in the TypeScript Playground](https://www.typescriptlang.org/play/#code/JYWwDg9gTgLgBDAnmApnA3nAwhANgGjgHEUA7FKAQxhQBNCA5AV110oCNc0BfOAMygQQcAEQABJKgDOAR1wB6AMbQU8yFJgBzKCikiA3AChQkWBjiKd1FAGU5cXgKGiJyXXLUQN23QePhoeEk0TDtcB35BYRF1LR09I2NSGig+SkU0ABEAIQxDAEgmKQopAC48-PzgWnKScioaWgAeEWBkgBYRAD4jSpQQSmBccpxcFpoADxhu3vzaYCkwNkQAfVJKEBRy5lYOLnGUKZmC-MsUa1oV6lqyCgvx0F0YDbAYAC9j-O5e2LKKqpqxFuDToLTaMAAHJ98pQmDAABbQFbVEZ4MEdaEwYAwLiosYiSbTHonZ6aP6jA5TADaAF1Pt9DNxDIZaChFGwdBYIKQNHBaOxymEjMoefBZOEALwWKw0MJNHJdAAU-IAlIkRbzfnApZQAO6DMVyRUFAAGNgAogAZc1YAAqcGqhCxOJQTsoZLgADEAEoAeQAsnAtQB1AAS5u95rgABIAIzauAAQQYAE04IrSVIVSb8AUROKRLmVQA6Q5suEoRVq5ms9mUTka+D87LATSCuRNTDsVvg8rdzTghzExtwfsJs7WOUK5XsFuaQhdnvJcowKBMHjVkfKJjJKQJvUG0et435M1Wm322EIpGOrk7mCKgBUKqTNjgpC9fsDWqIfoAqgACnA2RpleiJQMitA5oYJZlooFZVokB7YnA4rFqulA8ukWLcoqlBSIgpCKOmMATC+EpdBUyFBBMJ6noBmSJraUZaha9rOlwCZMGAqBQBm2JcC+YYRlGYE3rQCZxtBlQAOy5vksETOWNCIQUI4fjq+ooaRdEmpk57MZ+AZBl4MB7sJkYWPW8zrLg2KIBm7pZgmAAM0mKcpKA4PeqncNWhjioqZ7WnaDoST6xkhuGlmZnAYiUVJhD5nIIjVkAA) <span data-playground="postgres"></span> to hover the types and edit the SQL, with nothing to install.
|
|
30
30
|
|
|
31
31
|
## Documentation
|
|
32
32
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { RowKeys
|
|
1
|
+
import type { RowKeys } from "@typesql/core";
|
|
2
|
+
import { type TransactionalSql } from "@typesql/core/postgres";
|
|
2
3
|
import { type PostgresJsQueryable } from "./client.js";
|
|
3
4
|
import type { PostgresJsBigIntTypeMap, PostgresJsTypeMap } from "./type-map.js";
|
|
4
5
|
export { executor, type MigrationSource, migrate, type PostgresJsQueryable, type PostgresJsRows, type PostgresJsTransactable, } from "./client.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAc,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAc,MAAM,eAAe,CAAC;AAEzD,OAAO,EAGN,KAAK,gBAAgB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAU,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,EACN,QAAQ,EACR,KAAK,eAAe,EACpB,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC3B,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,aAAa,CACxB,EAAE,EACF,IAAI,SAAS,OAAO,GAAG,UAAU,EACjC,EAAE,GAAG,iBAAiB,IACnB,gBAAgB,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;AAMnC,wBAAgB,SAAS,CAAC,EAAE,EAC3B,GAAG,EAAE,mBAAmB,GAAG,SAAS,EACpC,OAAO,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;CAAE,GAC/D,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,uBAAuB,CAAC,CAAC;AAC3D,wBAAgB,SAAS,CAAC,EAAE,EAC3B,GAAG,EAAE,mBAAmB,GAAG,SAAS,EACpC,OAAO,EAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;CAAE,GAC/D,aAAa,CAAC,EAAE,EAAE,UAAU,EAAE,uBAAuB,CAAC,CAAC;AAC1D,wBAAgB,SAAS,CAAC,EAAE,EAC3B,GAAG,EAAE,mBAAmB,GAAG,SAAS,EACpC,OAAO,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,GACjE,aAAa,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;AAClC,wBAAgB,SAAS,CAAC,EAAE,EAC3B,GAAG,CAAC,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,GAClE,aAAa,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createTransactionalSql } from "@typesql/core/adapter";
|
|
2
|
+
import { postgres, } from "@typesql/core/postgres";
|
|
2
3
|
import { driver } from "./client.js";
|
|
3
4
|
export { executor, migrate, } from "./client.js";
|
|
4
5
|
export function createSql(sql, options) {
|
|
5
|
-
return createTransactionalSql(sql, driver, options);
|
|
6
|
+
return createTransactionalSql(postgres, sql, driver, options);
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAA4B,MAAM,aAAa,CAAC;AAG/D,OAAO,EACN,QAAQ,EAER,OAAO,GAIP,MAAM,aAAa,CAAC;AAiCrB,MAAM,UAAU,SAAS,CACxB,GAAyB,EACzB,OAA8B;IAE9B,OAAO,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAEN,QAAQ,GAER,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAA4B,MAAM,aAAa,CAAC;AAG/D,OAAO,EACN,QAAQ,EAER,OAAO,GAIP,MAAM,aAAa,CAAC;AAiCrB,MAAM,UAAU,SAAS,CACxB,GAAyB,EACzB,OAA8B;IAE9B,OAAO,sBAAsB,CAK3B,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC"}
|
package/dist/type-map.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefaultParamTypeMap, DefaultTypeMap } from "@typesql/core";
|
|
1
|
+
import type { DefaultParamTypeMap, DefaultTypeMap } from "@typesql/core/postgres";
|
|
2
2
|
export interface PostgresJsTypeMap extends Omit<DefaultTypeMap, "bytea" | "interval" | "point" | "circle" | "record" | "void"> {
|
|
3
3
|
$params: PostgresJsParamTypeMap;
|
|
4
4
|
bytea: Buffer;
|
package/dist/type-map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-map.d.ts","sourceRoot":"","sources":["../src/type-map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"type-map.d.ts","sourceRoot":"","sources":["../src/type-map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,mBAAmB,EACnB,cAAc,EACd,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,iBAChB,SAAQ,IAAI,CACX,cAAc,EACd,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAC7D;IACD,OAAO,EAAE,sBAAsB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAChB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC;IACvE,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7B,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,WAAW,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,uBAChB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;CACb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typesql/postgres",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "postgres.js adapter for TypeSQL.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@typesql/core": "0.
|
|
31
|
+
"@typesql/core": "0.8.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"postgres": ">=3"
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import type { RowKeys, SqlOptions
|
|
1
|
+
import type { RowKeys, SqlOptions } from "@typesql/core";
|
|
2
2
|
import { createTransactionalSql } from "@typesql/core/adapter";
|
|
3
|
+
import {
|
|
4
|
+
type Postgres,
|
|
5
|
+
postgres,
|
|
6
|
+
type TransactionalSql,
|
|
7
|
+
} from "@typesql/core/postgres";
|
|
3
8
|
import { driver, type PostgresJsQueryable } from "./client.js";
|
|
4
9
|
import type { PostgresJsBigIntTypeMap, PostgresJsTypeMap } from "./type-map.js";
|
|
5
10
|
|
|
@@ -47,9 +52,10 @@ export function createSql<DB>(
|
|
|
47
52
|
sql?: PostgresJsQueryable,
|
|
48
53
|
options?: PostgresJsSqlOptions,
|
|
49
54
|
): PostgresJsSql<DB, RowKeys, PostgresJsTypeMap | PostgresJsBigIntTypeMap> {
|
|
50
|
-
return createTransactionalSql<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
return createTransactionalSql<
|
|
56
|
+
Postgres,
|
|
57
|
+
DB,
|
|
58
|
+
PostgresJsTypeMap,
|
|
59
|
+
PostgresJsQueryable
|
|
60
|
+
>(postgres, sql, driver, options);
|
|
55
61
|
}
|