drizzle-orm 0.35.3-1b1151d → 0.35.3-57d2372
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 +73 -1
- package/pg-core/columns/index.cjs +12 -0
- package/pg-core/columns/index.cjs.map +1 -1
- package/pg-core/columns/index.d.cts +6 -0
- package/pg-core/columns/index.d.ts +6 -0
- package/pg-core/columns/index.js +6 -0
- package/pg-core/columns/index.js.map +1 -1
- package/pg-core/columns/postgis_extension/geography.cjs +104 -0
- package/pg-core/columns/postgis_extension/geography.cjs.map +1 -0
- package/pg-core/columns/postgis_extension/geography.d.cts +75 -0
- package/pg-core/columns/postgis_extension/geography.d.ts +75 -0
- package/pg-core/columns/postgis_extension/geography.js +76 -0
- package/pg-core/columns/postgis_extension/geography.js.map +1 -0
- package/pg-core/columns/postgres_internals/name.cjs +62 -0
- package/pg-core/columns/postgres_internals/name.cjs.map +1 -0
- package/pg-core/columns/postgres_internals/name.d.cts +25 -0
- package/pg-core/columns/postgres_internals/name.d.ts +25 -0
- package/pg-core/columns/postgres_internals/name.js +36 -0
- package/pg-core/columns/postgres_internals/name.js.map +1 -0
- package/pg-core/columns/postgres_internals/oid.cjs +62 -0
- package/pg-core/columns/postgres_internals/oid.cjs.map +1 -0
- package/pg-core/columns/postgres_internals/oid.d.cts +25 -0
- package/pg-core/columns/postgres_internals/oid.d.ts +25 -0
- package/pg-core/columns/postgres_internals/oid.js +36 -0
- package/pg-core/columns/postgres_internals/oid.js.map +1 -0
- package/pg-core/columns/timescale/compactstateagg.cjs +62 -0
- package/pg-core/columns/timescale/compactstateagg.cjs.map +1 -0
- package/pg-core/columns/timescale/compactstateagg.d.cts +25 -0
- package/pg-core/columns/timescale/compactstateagg.d.ts +25 -0
- package/pg-core/columns/timescale/compactstateagg.js +36 -0
- package/pg-core/columns/timescale/compactstateagg.js.map +1 -0
- package/pg-core/columns/timescale/heartbeatagg.cjs +62 -0
- package/pg-core/columns/timescale/heartbeatagg.cjs.map +1 -0
- package/pg-core/columns/timescale/heartbeatagg.d.cts +25 -0
- package/pg-core/columns/timescale/heartbeatagg.d.ts +25 -0
- package/pg-core/columns/timescale/heartbeatagg.js +36 -0
- package/pg-core/columns/timescale/heartbeatagg.js.map +1 -0
- package/pg-core/columns/timescale/stateagg.cjs +62 -0
- package/pg-core/columns/timescale/stateagg.cjs.map +1 -0
- package/pg-core/columns/timescale/stateagg.d.cts +25 -0
- package/pg-core/columns/timescale/stateagg.d.ts +25 -0
- package/pg-core/columns/timescale/stateagg.js +36 -0
- package/pg-core/columns/timescale/stateagg.js.map +1 -0
- package/version.cjs +1 -1
- package/version.d.cts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drizzle-orm",
|
|
3
|
-
"version": "0.35.3-
|
|
3
|
+
"version": "0.35.3-57d2372",
|
|
4
4
|
"description": "Drizzle ORM package for SQL databases",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -3740,6 +3740,18 @@
|
|
|
3740
3740
|
"types": "./sqlite-core/query-builders/update.d.ts",
|
|
3741
3741
|
"default": "./sqlite-core/query-builders/update.js"
|
|
3742
3742
|
},
|
|
3743
|
+
"./pg-core/columns/postgis_extension/geography": {
|
|
3744
|
+
"import": {
|
|
3745
|
+
"types": "./pg-core/columns/postgis_extension/geography.d.ts",
|
|
3746
|
+
"default": "./pg-core/columns/postgis_extension/geography.js"
|
|
3747
|
+
},
|
|
3748
|
+
"require": {
|
|
3749
|
+
"types": "./pg-core/columns/postgis_extension/geography.d.cts",
|
|
3750
|
+
"default": "./pg-core/columns/postgis_extension/geography.cjs"
|
|
3751
|
+
},
|
|
3752
|
+
"types": "./pg-core/columns/postgis_extension/geography.d.ts",
|
|
3753
|
+
"default": "./pg-core/columns/postgis_extension/geography.js"
|
|
3754
|
+
},
|
|
3743
3755
|
"./pg-core/columns/postgis_extension/geometry": {
|
|
3744
3756
|
"import": {
|
|
3745
3757
|
"types": "./pg-core/columns/postgis_extension/geometry.d.ts",
|
|
@@ -3764,6 +3776,66 @@
|
|
|
3764
3776
|
"types": "./pg-core/columns/postgis_extension/utils.d.ts",
|
|
3765
3777
|
"default": "./pg-core/columns/postgis_extension/utils.js"
|
|
3766
3778
|
},
|
|
3779
|
+
"./pg-core/columns/postgres_internals/name": {
|
|
3780
|
+
"import": {
|
|
3781
|
+
"types": "./pg-core/columns/postgres_internals/name.d.ts",
|
|
3782
|
+
"default": "./pg-core/columns/postgres_internals/name.js"
|
|
3783
|
+
},
|
|
3784
|
+
"require": {
|
|
3785
|
+
"types": "./pg-core/columns/postgres_internals/name.d.cts",
|
|
3786
|
+
"default": "./pg-core/columns/postgres_internals/name.cjs"
|
|
3787
|
+
},
|
|
3788
|
+
"types": "./pg-core/columns/postgres_internals/name.d.ts",
|
|
3789
|
+
"default": "./pg-core/columns/postgres_internals/name.js"
|
|
3790
|
+
},
|
|
3791
|
+
"./pg-core/columns/postgres_internals/oid": {
|
|
3792
|
+
"import": {
|
|
3793
|
+
"types": "./pg-core/columns/postgres_internals/oid.d.ts",
|
|
3794
|
+
"default": "./pg-core/columns/postgres_internals/oid.js"
|
|
3795
|
+
},
|
|
3796
|
+
"require": {
|
|
3797
|
+
"types": "./pg-core/columns/postgres_internals/oid.d.cts",
|
|
3798
|
+
"default": "./pg-core/columns/postgres_internals/oid.cjs"
|
|
3799
|
+
},
|
|
3800
|
+
"types": "./pg-core/columns/postgres_internals/oid.d.ts",
|
|
3801
|
+
"default": "./pg-core/columns/postgres_internals/oid.js"
|
|
3802
|
+
},
|
|
3803
|
+
"./pg-core/columns/timescale/compactstateagg": {
|
|
3804
|
+
"import": {
|
|
3805
|
+
"types": "./pg-core/columns/timescale/compactstateagg.d.ts",
|
|
3806
|
+
"default": "./pg-core/columns/timescale/compactstateagg.js"
|
|
3807
|
+
},
|
|
3808
|
+
"require": {
|
|
3809
|
+
"types": "./pg-core/columns/timescale/compactstateagg.d.cts",
|
|
3810
|
+
"default": "./pg-core/columns/timescale/compactstateagg.cjs"
|
|
3811
|
+
},
|
|
3812
|
+
"types": "./pg-core/columns/timescale/compactstateagg.d.ts",
|
|
3813
|
+
"default": "./pg-core/columns/timescale/compactstateagg.js"
|
|
3814
|
+
},
|
|
3815
|
+
"./pg-core/columns/timescale/heartbeatagg": {
|
|
3816
|
+
"import": {
|
|
3817
|
+
"types": "./pg-core/columns/timescale/heartbeatagg.d.ts",
|
|
3818
|
+
"default": "./pg-core/columns/timescale/heartbeatagg.js"
|
|
3819
|
+
},
|
|
3820
|
+
"require": {
|
|
3821
|
+
"types": "./pg-core/columns/timescale/heartbeatagg.d.cts",
|
|
3822
|
+
"default": "./pg-core/columns/timescale/heartbeatagg.cjs"
|
|
3823
|
+
},
|
|
3824
|
+
"types": "./pg-core/columns/timescale/heartbeatagg.d.ts",
|
|
3825
|
+
"default": "./pg-core/columns/timescale/heartbeatagg.js"
|
|
3826
|
+
},
|
|
3827
|
+
"./pg-core/columns/timescale/stateagg": {
|
|
3828
|
+
"import": {
|
|
3829
|
+
"types": "./pg-core/columns/timescale/stateagg.d.ts",
|
|
3830
|
+
"default": "./pg-core/columns/timescale/stateagg.js"
|
|
3831
|
+
},
|
|
3832
|
+
"require": {
|
|
3833
|
+
"types": "./pg-core/columns/timescale/stateagg.d.cts",
|
|
3834
|
+
"default": "./pg-core/columns/timescale/stateagg.cjs"
|
|
3835
|
+
},
|
|
3836
|
+
"types": "./pg-core/columns/timescale/stateagg.d.ts",
|
|
3837
|
+
"default": "./pg-core/columns/timescale/stateagg.js"
|
|
3838
|
+
},
|
|
3767
3839
|
"./pg-core/columns/vector_extension/bit": {
|
|
3768
3840
|
"import": {
|
|
3769
3841
|
"types": "./pg-core/columns/vector_extension/bit.d.ts",
|
|
@@ -36,13 +36,19 @@ __reExport(columns_exports, require("./macaddr.cjs"), module.exports);
|
|
|
36
36
|
__reExport(columns_exports, require("./macaddr8.cjs"), module.exports);
|
|
37
37
|
__reExport(columns_exports, require("./numeric.cjs"), module.exports);
|
|
38
38
|
__reExport(columns_exports, require("./point.cjs"), module.exports);
|
|
39
|
+
__reExport(columns_exports, require("./postgis_extension/geography.cjs"), module.exports);
|
|
39
40
|
__reExport(columns_exports, require("./postgis_extension/geometry.cjs"), module.exports);
|
|
41
|
+
__reExport(columns_exports, require("./postgres_internals/name.cjs"), module.exports);
|
|
42
|
+
__reExport(columns_exports, require("./postgres_internals/oid.cjs"), module.exports);
|
|
40
43
|
__reExport(columns_exports, require("./real.cjs"), module.exports);
|
|
41
44
|
__reExport(columns_exports, require("./serial.cjs"), module.exports);
|
|
42
45
|
__reExport(columns_exports, require("./smallint.cjs"), module.exports);
|
|
43
46
|
__reExport(columns_exports, require("./smallserial.cjs"), module.exports);
|
|
44
47
|
__reExport(columns_exports, require("./text.cjs"), module.exports);
|
|
45
48
|
__reExport(columns_exports, require("./time.cjs"), module.exports);
|
|
49
|
+
__reExport(columns_exports, require("./timescale/compactstateagg.cjs"), module.exports);
|
|
50
|
+
__reExport(columns_exports, require("./timescale/heartbeatagg.cjs"), module.exports);
|
|
51
|
+
__reExport(columns_exports, require("./timescale/stateagg.cjs"), module.exports);
|
|
46
52
|
__reExport(columns_exports, require("./timestamp.cjs"), module.exports);
|
|
47
53
|
__reExport(columns_exports, require("./uuid.cjs"), module.exports);
|
|
48
54
|
__reExport(columns_exports, require("./varchar.cjs"), module.exports);
|
|
@@ -73,13 +79,19 @@ __reExport(columns_exports, require("./vector_extension/vector.cjs"), module.exp
|
|
|
73
79
|
...require("./macaddr8.cjs"),
|
|
74
80
|
...require("./numeric.cjs"),
|
|
75
81
|
...require("./point.cjs"),
|
|
82
|
+
...require("./postgis_extension/geography.cjs"),
|
|
76
83
|
...require("./postgis_extension/geometry.cjs"),
|
|
84
|
+
...require("./postgres_internals/name.cjs"),
|
|
85
|
+
...require("./postgres_internals/oid.cjs"),
|
|
77
86
|
...require("./real.cjs"),
|
|
78
87
|
...require("./serial.cjs"),
|
|
79
88
|
...require("./smallint.cjs"),
|
|
80
89
|
...require("./smallserial.cjs"),
|
|
81
90
|
...require("./text.cjs"),
|
|
82
91
|
...require("./time.cjs"),
|
|
92
|
+
...require("./timescale/compactstateagg.cjs"),
|
|
93
|
+
...require("./timescale/heartbeatagg.cjs"),
|
|
94
|
+
...require("./timescale/stateagg.cjs"),
|
|
83
95
|
...require("./timestamp.cjs"),
|
|
84
96
|
...require("./uuid.cjs"),
|
|
85
97
|
...require("./varchar.cjs"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/pg-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './bigserial.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './cidr.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './double-precision.ts';\nexport * from './enum.ts';\nexport * from './inet.ts';\nexport * from './int.common.ts';\nexport * from './integer.ts';\nexport * from './interval.ts';\nexport * from './json.ts';\nexport * from './jsonb.ts';\nexport * from './line.ts';\nexport * from './macaddr.ts';\nexport * from './macaddr8.ts';\nexport * from './numeric.ts';\nexport * from './point.ts';\nexport * from './postgis_extension/geometry.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './smallserial.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timestamp.ts';\nexport * from './uuid.ts';\nexport * from './varchar.ts';\nexport * from './vector_extension/bit.ts';\nexport * from './vector_extension/halfvec.ts';\nexport * from './vector_extension/sparsevec.ts';\nexport * from './vector_extension/vector.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,wBAAd;AACA,4BAAc,2BADd;AAEA,4BAAc,yBAFd;AAGA,4BAAc,sBAHd;AAIA,4BAAc,sBAJd;AAKA,4BAAc,wBALd;AAMA,4BAAc,wBANd;AAOA,4BAAc,sBAPd;AAQA,4BAAc,kCARd;AASA,4BAAc,sBATd;AAUA,4BAAc,sBAVd;AAWA,4BAAc,4BAXd;AAYA,4BAAc,yBAZd;AAaA,4BAAc,0BAbd;AAcA,4BAAc,sBAdd;AAeA,4BAAc,uBAfd;AAgBA,4BAAc,sBAhBd;AAiBA,4BAAc,yBAjBd;AAkBA,4BAAc,0BAlBd;AAmBA,4BAAc,yBAnBd;AAoBA,4BAAc,uBApBd;AAqBA,4BAAc,
|
|
1
|
+
{"version":3,"sources":["../../../src/pg-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './bigserial.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './cidr.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './double-precision.ts';\nexport * from './enum.ts';\nexport * from './inet.ts';\nexport * from './int.common.ts';\nexport * from './integer.ts';\nexport * from './interval.ts';\nexport * from './json.ts';\nexport * from './jsonb.ts';\nexport * from './line.ts';\nexport * from './macaddr.ts';\nexport * from './macaddr8.ts';\nexport * from './numeric.ts';\nexport * from './point.ts';\nexport * from './postgis_extension/geography.ts';\nexport * from './postgis_extension/geometry.ts';\nexport * from './postgres_internals/name.ts';\nexport * from './postgres_internals/oid.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './smallserial.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timescale/compactstateagg.ts';\nexport * from './timescale/heartbeatagg.ts';\nexport * from './timescale/stateagg.ts';\nexport * from './timestamp.ts';\nexport * from './uuid.ts';\nexport * from './varchar.ts';\nexport * from './vector_extension/bit.ts';\nexport * from './vector_extension/halfvec.ts';\nexport * from './vector_extension/sparsevec.ts';\nexport * from './vector_extension/vector.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,wBAAd;AACA,4BAAc,2BADd;AAEA,4BAAc,yBAFd;AAGA,4BAAc,sBAHd;AAIA,4BAAc,sBAJd;AAKA,4BAAc,wBALd;AAMA,4BAAc,wBANd;AAOA,4BAAc,sBAPd;AAQA,4BAAc,kCARd;AASA,4BAAc,sBATd;AAUA,4BAAc,sBAVd;AAWA,4BAAc,4BAXd;AAYA,4BAAc,yBAZd;AAaA,4BAAc,0BAbd;AAcA,4BAAc,sBAdd;AAeA,4BAAc,uBAfd;AAgBA,4BAAc,sBAhBd;AAiBA,4BAAc,yBAjBd;AAkBA,4BAAc,0BAlBd;AAmBA,4BAAc,yBAnBd;AAoBA,4BAAc,uBApBd;AAqBA,4BAAc,6CArBd;AAsBA,4BAAc,4CAtBd;AAuBA,4BAAc,yCAvBd;AAwBA,4BAAc,wCAxBd;AAyBA,4BAAc,sBAzBd;AA0BA,4BAAc,wBA1Bd;AA2BA,4BAAc,0BA3Bd;AA4BA,4BAAc,6BA5Bd;AA6BA,4BAAc,sBA7Bd;AA8BA,4BAAc,sBA9Bd;AA+BA,4BAAc,2CA/Bd;AAgCA,4BAAc,wCAhCd;AAiCA,4BAAc,oCAjCd;AAkCA,4BAAc,2BAlCd;AAmCA,4BAAc,sBAnCd;AAoCA,4BAAc,yBApCd;AAqCA,4BAAc,sCArCd;AAsCA,4BAAc,0CAtCd;AAuCA,4BAAc,4CAvCd;AAwCA,4BAAc,yCAxCd;","names":[]}
|
|
@@ -19,13 +19,19 @@ export * from "./macaddr.cjs";
|
|
|
19
19
|
export * from "./macaddr8.cjs";
|
|
20
20
|
export * from "./numeric.cjs";
|
|
21
21
|
export * from "./point.cjs";
|
|
22
|
+
export * from "./postgis_extension/geography.cjs";
|
|
22
23
|
export * from "./postgis_extension/geometry.cjs";
|
|
24
|
+
export * from "./postgres_internals/name.cjs";
|
|
25
|
+
export * from "./postgres_internals/oid.cjs";
|
|
23
26
|
export * from "./real.cjs";
|
|
24
27
|
export * from "./serial.cjs";
|
|
25
28
|
export * from "./smallint.cjs";
|
|
26
29
|
export * from "./smallserial.cjs";
|
|
27
30
|
export * from "./text.cjs";
|
|
28
31
|
export * from "./time.cjs";
|
|
32
|
+
export * from "./timescale/compactstateagg.cjs";
|
|
33
|
+
export * from "./timescale/heartbeatagg.cjs";
|
|
34
|
+
export * from "./timescale/stateagg.cjs";
|
|
29
35
|
export * from "./timestamp.cjs";
|
|
30
36
|
export * from "./uuid.cjs";
|
|
31
37
|
export * from "./varchar.cjs";
|
|
@@ -19,13 +19,19 @@ export * from "./macaddr.js";
|
|
|
19
19
|
export * from "./macaddr8.js";
|
|
20
20
|
export * from "./numeric.js";
|
|
21
21
|
export * from "./point.js";
|
|
22
|
+
export * from "./postgis_extension/geography.js";
|
|
22
23
|
export * from "./postgis_extension/geometry.js";
|
|
24
|
+
export * from "./postgres_internals/name.js";
|
|
25
|
+
export * from "./postgres_internals/oid.js";
|
|
23
26
|
export * from "./real.js";
|
|
24
27
|
export * from "./serial.js";
|
|
25
28
|
export * from "./smallint.js";
|
|
26
29
|
export * from "./smallserial.js";
|
|
27
30
|
export * from "./text.js";
|
|
28
31
|
export * from "./time.js";
|
|
32
|
+
export * from "./timescale/compactstateagg.js";
|
|
33
|
+
export * from "./timescale/heartbeatagg.js";
|
|
34
|
+
export * from "./timescale/stateagg.js";
|
|
29
35
|
export * from "./timestamp.js";
|
|
30
36
|
export * from "./uuid.js";
|
|
31
37
|
export * from "./varchar.js";
|
package/pg-core/columns/index.js
CHANGED
|
@@ -19,13 +19,19 @@ export * from "./macaddr.js";
|
|
|
19
19
|
export * from "./macaddr8.js";
|
|
20
20
|
export * from "./numeric.js";
|
|
21
21
|
export * from "./point.js";
|
|
22
|
+
export * from "./postgis_extension/geography.js";
|
|
22
23
|
export * from "./postgis_extension/geometry.js";
|
|
24
|
+
export * from "./postgres_internals/name.js";
|
|
25
|
+
export * from "./postgres_internals/oid.js";
|
|
23
26
|
export * from "./real.js";
|
|
24
27
|
export * from "./serial.js";
|
|
25
28
|
export * from "./smallint.js";
|
|
26
29
|
export * from "./smallserial.js";
|
|
27
30
|
export * from "./text.js";
|
|
28
31
|
export * from "./time.js";
|
|
32
|
+
export * from "./timescale/compactstateagg.js";
|
|
33
|
+
export * from "./timescale/heartbeatagg.js";
|
|
34
|
+
export * from "./timescale/stateagg.js";
|
|
29
35
|
export * from "./timestamp.js";
|
|
30
36
|
export * from "./uuid.js";
|
|
31
37
|
export * from "./varchar.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/pg-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './bigserial.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './cidr.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './double-precision.ts';\nexport * from './enum.ts';\nexport * from './inet.ts';\nexport * from './int.common.ts';\nexport * from './integer.ts';\nexport * from './interval.ts';\nexport * from './json.ts';\nexport * from './jsonb.ts';\nexport * from './line.ts';\nexport * from './macaddr.ts';\nexport * from './macaddr8.ts';\nexport * from './numeric.ts';\nexport * from './point.ts';\nexport * from './postgis_extension/geometry.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './smallserial.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timestamp.ts';\nexport * from './uuid.ts';\nexport * from './varchar.ts';\nexport * from './vector_extension/bit.ts';\nexport * from './vector_extension/halfvec.ts';\nexport * from './vector_extension/sparsevec.ts';\nexport * from './vector_extension/vector.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/pg-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './bigserial.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './cidr.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './double-precision.ts';\nexport * from './enum.ts';\nexport * from './inet.ts';\nexport * from './int.common.ts';\nexport * from './integer.ts';\nexport * from './interval.ts';\nexport * from './json.ts';\nexport * from './jsonb.ts';\nexport * from './line.ts';\nexport * from './macaddr.ts';\nexport * from './macaddr8.ts';\nexport * from './numeric.ts';\nexport * from './point.ts';\nexport * from './postgis_extension/geography.ts';\nexport * from './postgis_extension/geometry.ts';\nexport * from './postgres_internals/name.ts';\nexport * from './postgres_internals/oid.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './smallserial.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timescale/compactstateagg.ts';\nexport * from './timescale/heartbeatagg.ts';\nexport * from './timescale/stateagg.ts';\nexport * from './timestamp.ts';\nexport * from './uuid.ts';\nexport * from './varchar.ts';\nexport * from './vector_extension/bit.ts';\nexport * from './vector_extension/halfvec.ts';\nexport * from './vector_extension/sparsevec.ts';\nexport * from './vector_extension/vector.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var geography_exports = {};
|
|
20
|
+
__export(geography_exports, {
|
|
21
|
+
PgGeography: () => PgGeography,
|
|
22
|
+
PgGeographyBuilder: () => PgGeographyBuilder,
|
|
23
|
+
PgGeographyObject: () => PgGeographyObject,
|
|
24
|
+
PgGeographyObjectBuilder: () => PgGeographyObjectBuilder,
|
|
25
|
+
geography: () => geography
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(geography_exports);
|
|
28
|
+
var import_entity = require("../../../entity.cjs");
|
|
29
|
+
var import_common = require("../common.cjs");
|
|
30
|
+
var import_utils = require("./utils.cjs");
|
|
31
|
+
class PgGeographyBuilder extends import_common.PgColumnBuilder {
|
|
32
|
+
static [import_entity.entityKind] = "PgGeographyBuilder";
|
|
33
|
+
constructor(name, config) {
|
|
34
|
+
super(name, "array", "PgGeography");
|
|
35
|
+
this.config.srid = config?.srid;
|
|
36
|
+
this.config.type = config?.type;
|
|
37
|
+
}
|
|
38
|
+
/** @internal */
|
|
39
|
+
build(table) {
|
|
40
|
+
return new PgGeography(
|
|
41
|
+
table,
|
|
42
|
+
this.config
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class PgGeography extends import_common.PgColumn {
|
|
47
|
+
static [import_entity.entityKind] = "PgGeography";
|
|
48
|
+
type = this.config.type;
|
|
49
|
+
srid = this.config.srid;
|
|
50
|
+
getSQLType() {
|
|
51
|
+
return `geography${this.type || this.srid ? `(${this.type ?? ""}${this.srid ? this.type ? `,${this.srid}` : this.srid : ""})` : ""}`;
|
|
52
|
+
}
|
|
53
|
+
mapFromDriverValue(value) {
|
|
54
|
+
return (0, import_utils.parseEWKB)(value);
|
|
55
|
+
}
|
|
56
|
+
mapToDriverValue(value) {
|
|
57
|
+
return `point(${value[0]} ${value[1]})`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
class PgGeographyObjectBuilder extends import_common.PgColumnBuilder {
|
|
61
|
+
static [import_entity.entityKind] = "PgGeographyObjectBuilder";
|
|
62
|
+
constructor(name, config) {
|
|
63
|
+
super(name, "json", "PgGeographyObject");
|
|
64
|
+
this.config.srid = config?.srid;
|
|
65
|
+
this.config.type = config?.type;
|
|
66
|
+
}
|
|
67
|
+
/** @internal */
|
|
68
|
+
build(table) {
|
|
69
|
+
return new PgGeographyObject(
|
|
70
|
+
table,
|
|
71
|
+
this.config
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class PgGeographyObject extends import_common.PgColumn {
|
|
76
|
+
static [import_entity.entityKind] = "PgGeographyObject";
|
|
77
|
+
type = this.config.type;
|
|
78
|
+
srid = this.config.srid;
|
|
79
|
+
getSQLType() {
|
|
80
|
+
return `geography${this.type || this.srid ? `(${this.type ?? ""}${this.srid ? this.type ? `,${this.srid}` : this.srid : ""})` : ""}`;
|
|
81
|
+
}
|
|
82
|
+
mapFromDriverValue(value) {
|
|
83
|
+
const parsed = (0, import_utils.parseEWKB)(value);
|
|
84
|
+
return { x: parsed[0], y: parsed[1] };
|
|
85
|
+
}
|
|
86
|
+
mapToDriverValue(value) {
|
|
87
|
+
return `geography(${value.x} ${value.y})`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function geography(name, config) {
|
|
91
|
+
if (!config?.mode || config.mode === "tuple") {
|
|
92
|
+
return new PgGeographyBuilder(name, config);
|
|
93
|
+
}
|
|
94
|
+
return new PgGeographyObjectBuilder(name, config);
|
|
95
|
+
}
|
|
96
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
97
|
+
0 && (module.exports = {
|
|
98
|
+
PgGeography,
|
|
99
|
+
PgGeographyBuilder,
|
|
100
|
+
PgGeographyObject,
|
|
101
|
+
PgGeographyObjectBuilder,
|
|
102
|
+
geography
|
|
103
|
+
});
|
|
104
|
+
//# sourceMappingURL=geography.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/pg-core/columns/postgis_extension/geography.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyPgTable } from '~/pg-core/table.ts';\n\nimport type { Equal } from '~/utils.ts';\nimport { PgColumn, PgColumnBuilder } from '../common.ts';\nimport { parseEWKB } from './utils.ts';\n\nexport type PgGeographyBuilderInitial<TName extends string> = PgGeographyBuilder<{\n\tname: TName;\n\tdataType: 'array';\n\tcolumnType: 'PgGeography';\n\tdata: [number, number];\n\tdriverParam: string;\n\tenumValues: undefined;\n\tgenerated: undefined;\n}>;\n\nexport class PgGeographyBuilder<T extends ColumnBuilderBaseConfig<'array', 'PgGeography'>>\n\textends PgColumnBuilder<T, { type: PgGeographyConfig['type']; srid: PgGeographyConfig['srid'] }>\n{\n\tstatic override readonly [entityKind]: string = 'PgGeographyBuilder';\n\n\tconstructor(name: T['name'], config?: PgGeographyConfig) {\n\t\tsuper(name, 'array', 'PgGeography');\n\t\tthis.config.srid = config?.srid;\n\t\tthis.config.type = config?.type;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgGeography<MakeColumnConfig<T, TTableName>> {\n\t\treturn new PgGeography<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class PgGeography<T extends ColumnBaseConfig<'array', 'PgGeography'>>\n\textends PgColumn<T, { type: PgGeographyConfig['type']; srid: PgGeographyConfig['srid'] }>\n{\n\tstatic override readonly [entityKind]: string = 'PgGeography';\n\n\treadonly type = this.config.type;\n\treadonly srid = this.config.srid;\n\n\tgetSQLType(): string {\n\t\treturn `geography${\n\t\t\tthis.type || this.srid ? `(${this.type ?? ''}${this.srid ? this.type ? `,${this.srid}` : this.srid : ''})` : ''\n\t\t}`;\n\t}\n\n\toverride mapFromDriverValue(value: string): [number, number] {\n\t\treturn parseEWKB(value);\n\t}\n\n\toverride mapToDriverValue(value: [number, number]): string {\n\t\treturn `point(${value[0]} ${value[1]})`;\n\t}\n}\n\nexport type PgGeographyObjectBuilderInitial<TName extends string> = PgGeographyObjectBuilder<{\n\tname: TName;\n\tdataType: 'json';\n\tcolumnType: 'PgGeographyObject';\n\tdata: { x: number; y: number };\n\tdriverParam: string;\n\tenumValues: undefined;\n\tgenerated: undefined;\n}>;\n\nexport class PgGeographyObjectBuilder<T extends ColumnBuilderBaseConfig<'json', 'PgGeographyObject'>>\n\textends PgColumnBuilder<T, { type: PgGeographyConfig['type']; srid: PgGeographyConfig['srid'] }>\n{\n\tstatic override readonly [entityKind]: string = 'PgGeographyObjectBuilder';\n\n\tconstructor(name: T['name'], config?: PgGeographyConfig) {\n\t\tsuper(name, 'json', 'PgGeographyObject');\n\t\tthis.config.srid = config?.srid;\n\t\tthis.config.type = config?.type;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgGeographyObject<MakeColumnConfig<T, TTableName>> {\n\t\treturn new PgGeographyObject<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class PgGeographyObject<T extends ColumnBaseConfig<'json', 'PgGeographyObject'>>\n\textends PgColumn<T, { type: PgGeographyConfig['type']; srid: PgGeographyConfig['srid'] }>\n{\n\tstatic override readonly [entityKind]: string = 'PgGeographyObject';\n\n\treadonly type = this.config.type;\n\treadonly srid = this.config.srid;\n\n\tgetSQLType(): string {\n\t\treturn `geography${\n\t\t\tthis.type || this.srid ? `(${this.type ?? ''}${this.srid ? this.type ? `,${this.srid}` : this.srid : ''})` : ''\n\t\t}`;\n\t}\n\n\toverride mapFromDriverValue(value: string): { x: number; y: number } {\n\t\tconst parsed = parseEWKB(value);\n\t\treturn { x: parsed[0], y: parsed[1] };\n\t}\n\n\toverride mapToDriverValue(value: { x: number; y: number }): string {\n\t\treturn `geography(${value.x} ${value.y})`;\n\t}\n}\n\ninterface PgGeographyConfig<T extends 'tuple' | 'xy' = 'tuple' | 'xy'> {\n\tmode?: T;\n\ttype?: 'point' | (string & {});\n\tsrid?: number;\n}\n\nexport function geography<TName extends string, TMode extends PgGeographyConfig['mode'] & {}>(\n\tname: TName,\n\tconfig?: PgGeographyConfig<TMode>,\n): Equal<TMode, 'xy'> extends true ? PgGeographyObjectBuilderInitial<TName>\n\t: PgGeographyBuilderInitial<TName>;\nexport function geography(name: string, config?: PgGeographyConfig) {\n\tif (!config?.mode || config.mode === 'tuple') {\n\t\treturn new PgGeographyBuilder(name, config);\n\t}\n\treturn new PgGeographyObjectBuilder(name, config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAI3B,oBAA0C;AAC1C,mBAA0B;AAYnB,MAAM,2BACJ,8BACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAA4B;AACxD,UAAM,MAAM,SAAS,aAAa;AAClC,SAAK,OAAO,OAAO,QAAQ;AAC3B,SAAK,OAAO,OAAO,QAAQ;AAAA,EAC5B;AAAA;AAAA,EAGS,MACR,OAC+C;AAC/C,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,oBACJ,uBACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEvC,OAAO,KAAK,OAAO;AAAA,EACnB,OAAO,KAAK,OAAO;AAAA,EAE5B,aAAqB;AACpB,WAAO,YACN,KAAK,QAAQ,KAAK,OAAO,IAAI,KAAK,QAAQ,EAAE,GAAG,KAAK,OAAO,KAAK,OAAO,IAAI,KAAK,IAAI,KAAK,KAAK,OAAO,EAAE,MAAM,EAC9G;AAAA,EACD;AAAA,EAES,mBAAmB,OAAiC;AAC5D,eAAO,wBAAU,KAAK;AAAA,EACvB;AAAA,EAES,iBAAiB,OAAiC;AAC1D,WAAO,SAAS,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA,EACrC;AACD;AAYO,MAAM,iCACJ,8BACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAA4B;AACxD,UAAM,MAAM,QAAQ,mBAAmB;AACvC,SAAK,OAAO,OAAO,QAAQ;AAC3B,SAAK,OAAO,OAAO,QAAQ;AAAA,EAC5B;AAAA;AAAA,EAGS,MACR,OACqD;AACrD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,0BACJ,uBACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEvC,OAAO,KAAK,OAAO;AAAA,EACnB,OAAO,KAAK,OAAO;AAAA,EAE5B,aAAqB;AACpB,WAAO,YACN,KAAK,QAAQ,KAAK,OAAO,IAAI,KAAK,QAAQ,EAAE,GAAG,KAAK,OAAO,KAAK,OAAO,IAAI,KAAK,IAAI,KAAK,KAAK,OAAO,EAAE,MAAM,EAC9G;AAAA,EACD;AAAA,EAES,mBAAmB,OAAyC;AACpE,UAAM,aAAS,wBAAU,KAAK;AAC9B,WAAO,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,EAAE;AAAA,EACrC;AAAA,EAES,iBAAiB,OAAyC;AAClE,WAAO,aAAa,MAAM,CAAC,IAAI,MAAM,CAAC;AAAA,EACvC;AACD;AAaO,SAAS,UAAU,MAAc,QAA4B;AACnE,MAAI,CAAC,QAAQ,QAAQ,OAAO,SAAS,SAAS;AAC7C,WAAO,IAAI,mBAAmB,MAAM,MAAM;AAAA,EAC3C;AACA,SAAO,IAAI,yBAAyB,MAAM,MAAM;AACjD;","names":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ColumnBuilderBaseConfig } from "../../../column-builder.cjs";
|
|
2
|
+
import type { ColumnBaseConfig } from "../../../column.cjs";
|
|
3
|
+
import { entityKind } from "../../../entity.cjs";
|
|
4
|
+
import type { Equal } from "../../../utils.cjs";
|
|
5
|
+
import { PgColumn, PgColumnBuilder } from "../common.cjs";
|
|
6
|
+
export type PgGeographyBuilderInitial<TName extends string> = PgGeographyBuilder<{
|
|
7
|
+
name: TName;
|
|
8
|
+
dataType: 'array';
|
|
9
|
+
columnType: 'PgGeography';
|
|
10
|
+
data: [number, number];
|
|
11
|
+
driverParam: string;
|
|
12
|
+
enumValues: undefined;
|
|
13
|
+
generated: undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare class PgGeographyBuilder<T extends ColumnBuilderBaseConfig<'array', 'PgGeography'>> extends PgColumnBuilder<T, {
|
|
16
|
+
type: PgGeographyConfig['type'];
|
|
17
|
+
srid: PgGeographyConfig['srid'];
|
|
18
|
+
}> {
|
|
19
|
+
static readonly [entityKind]: string;
|
|
20
|
+
constructor(name: T['name'], config?: PgGeographyConfig);
|
|
21
|
+
}
|
|
22
|
+
export declare class PgGeography<T extends ColumnBaseConfig<'array', 'PgGeography'>> extends PgColumn<T, {
|
|
23
|
+
type: PgGeographyConfig['type'];
|
|
24
|
+
srid: PgGeographyConfig['srid'];
|
|
25
|
+
}> {
|
|
26
|
+
static readonly [entityKind]: string;
|
|
27
|
+
readonly type: "point" | (string & {}) | undefined;
|
|
28
|
+
readonly srid: number | undefined;
|
|
29
|
+
getSQLType(): string;
|
|
30
|
+
mapFromDriverValue(value: string): [number, number];
|
|
31
|
+
mapToDriverValue(value: [number, number]): string;
|
|
32
|
+
}
|
|
33
|
+
export type PgGeographyObjectBuilderInitial<TName extends string> = PgGeographyObjectBuilder<{
|
|
34
|
+
name: TName;
|
|
35
|
+
dataType: 'json';
|
|
36
|
+
columnType: 'PgGeographyObject';
|
|
37
|
+
data: {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
};
|
|
41
|
+
driverParam: string;
|
|
42
|
+
enumValues: undefined;
|
|
43
|
+
generated: undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare class PgGeographyObjectBuilder<T extends ColumnBuilderBaseConfig<'json', 'PgGeographyObject'>> extends PgColumnBuilder<T, {
|
|
46
|
+
type: PgGeographyConfig['type'];
|
|
47
|
+
srid: PgGeographyConfig['srid'];
|
|
48
|
+
}> {
|
|
49
|
+
static readonly [entityKind]: string;
|
|
50
|
+
constructor(name: T['name'], config?: PgGeographyConfig);
|
|
51
|
+
}
|
|
52
|
+
export declare class PgGeographyObject<T extends ColumnBaseConfig<'json', 'PgGeographyObject'>> extends PgColumn<T, {
|
|
53
|
+
type: PgGeographyConfig['type'];
|
|
54
|
+
srid: PgGeographyConfig['srid'];
|
|
55
|
+
}> {
|
|
56
|
+
static readonly [entityKind]: string;
|
|
57
|
+
readonly type: "point" | (string & {}) | undefined;
|
|
58
|
+
readonly srid: number | undefined;
|
|
59
|
+
getSQLType(): string;
|
|
60
|
+
mapFromDriverValue(value: string): {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
};
|
|
64
|
+
mapToDriverValue(value: {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
}): string;
|
|
68
|
+
}
|
|
69
|
+
interface PgGeographyConfig<T extends 'tuple' | 'xy' = 'tuple' | 'xy'> {
|
|
70
|
+
mode?: T;
|
|
71
|
+
type?: 'point' | (string & {});
|
|
72
|
+
srid?: number;
|
|
73
|
+
}
|
|
74
|
+
export declare function geography<TName extends string, TMode extends PgGeographyConfig['mode'] & {}>(name: TName, config?: PgGeographyConfig<TMode>): Equal<TMode, 'xy'> extends true ? PgGeographyObjectBuilderInitial<TName> : PgGeographyBuilderInitial<TName>;
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ColumnBuilderBaseConfig } from "../../../column-builder.js";
|
|
2
|
+
import type { ColumnBaseConfig } from "../../../column.js";
|
|
3
|
+
import { entityKind } from "../../../entity.js";
|
|
4
|
+
import type { Equal } from "../../../utils.js";
|
|
5
|
+
import { PgColumn, PgColumnBuilder } from "../common.js";
|
|
6
|
+
export type PgGeographyBuilderInitial<TName extends string> = PgGeographyBuilder<{
|
|
7
|
+
name: TName;
|
|
8
|
+
dataType: 'array';
|
|
9
|
+
columnType: 'PgGeography';
|
|
10
|
+
data: [number, number];
|
|
11
|
+
driverParam: string;
|
|
12
|
+
enumValues: undefined;
|
|
13
|
+
generated: undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare class PgGeographyBuilder<T extends ColumnBuilderBaseConfig<'array', 'PgGeography'>> extends PgColumnBuilder<T, {
|
|
16
|
+
type: PgGeographyConfig['type'];
|
|
17
|
+
srid: PgGeographyConfig['srid'];
|
|
18
|
+
}> {
|
|
19
|
+
static readonly [entityKind]: string;
|
|
20
|
+
constructor(name: T['name'], config?: PgGeographyConfig);
|
|
21
|
+
}
|
|
22
|
+
export declare class PgGeography<T extends ColumnBaseConfig<'array', 'PgGeography'>> extends PgColumn<T, {
|
|
23
|
+
type: PgGeographyConfig['type'];
|
|
24
|
+
srid: PgGeographyConfig['srid'];
|
|
25
|
+
}> {
|
|
26
|
+
static readonly [entityKind]: string;
|
|
27
|
+
readonly type: "point" | (string & {}) | undefined;
|
|
28
|
+
readonly srid: number | undefined;
|
|
29
|
+
getSQLType(): string;
|
|
30
|
+
mapFromDriverValue(value: string): [number, number];
|
|
31
|
+
mapToDriverValue(value: [number, number]): string;
|
|
32
|
+
}
|
|
33
|
+
export type PgGeographyObjectBuilderInitial<TName extends string> = PgGeographyObjectBuilder<{
|
|
34
|
+
name: TName;
|
|
35
|
+
dataType: 'json';
|
|
36
|
+
columnType: 'PgGeographyObject';
|
|
37
|
+
data: {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
};
|
|
41
|
+
driverParam: string;
|
|
42
|
+
enumValues: undefined;
|
|
43
|
+
generated: undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare class PgGeographyObjectBuilder<T extends ColumnBuilderBaseConfig<'json', 'PgGeographyObject'>> extends PgColumnBuilder<T, {
|
|
46
|
+
type: PgGeographyConfig['type'];
|
|
47
|
+
srid: PgGeographyConfig['srid'];
|
|
48
|
+
}> {
|
|
49
|
+
static readonly [entityKind]: string;
|
|
50
|
+
constructor(name: T['name'], config?: PgGeographyConfig);
|
|
51
|
+
}
|
|
52
|
+
export declare class PgGeographyObject<T extends ColumnBaseConfig<'json', 'PgGeographyObject'>> extends PgColumn<T, {
|
|
53
|
+
type: PgGeographyConfig['type'];
|
|
54
|
+
srid: PgGeographyConfig['srid'];
|
|
55
|
+
}> {
|
|
56
|
+
static readonly [entityKind]: string;
|
|
57
|
+
readonly type: "point" | (string & {}) | undefined;
|
|
58
|
+
readonly srid: number | undefined;
|
|
59
|
+
getSQLType(): string;
|
|
60
|
+
mapFromDriverValue(value: string): {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
};
|
|
64
|
+
mapToDriverValue(value: {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
}): string;
|
|
68
|
+
}
|
|
69
|
+
interface PgGeographyConfig<T extends 'tuple' | 'xy' = 'tuple' | 'xy'> {
|
|
70
|
+
mode?: T;
|
|
71
|
+
type?: 'point' | (string & {});
|
|
72
|
+
srid?: number;
|
|
73
|
+
}
|
|
74
|
+
export declare function geography<TName extends string, TMode extends PgGeographyConfig['mode'] & {}>(name: TName, config?: PgGeographyConfig<TMode>): Equal<TMode, 'xy'> extends true ? PgGeographyObjectBuilderInitial<TName> : PgGeographyBuilderInitial<TName>;
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { entityKind } from "../../../entity.js";
|
|
2
|
+
import { PgColumn, PgColumnBuilder } from "../common.js";
|
|
3
|
+
import { parseEWKB } from "./utils.js";
|
|
4
|
+
class PgGeographyBuilder extends PgColumnBuilder {
|
|
5
|
+
static [entityKind] = "PgGeographyBuilder";
|
|
6
|
+
constructor(name, config) {
|
|
7
|
+
super(name, "array", "PgGeography");
|
|
8
|
+
this.config.srid = config?.srid;
|
|
9
|
+
this.config.type = config?.type;
|
|
10
|
+
}
|
|
11
|
+
/** @internal */
|
|
12
|
+
build(table) {
|
|
13
|
+
return new PgGeography(
|
|
14
|
+
table,
|
|
15
|
+
this.config
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
class PgGeography extends PgColumn {
|
|
20
|
+
static [entityKind] = "PgGeography";
|
|
21
|
+
type = this.config.type;
|
|
22
|
+
srid = this.config.srid;
|
|
23
|
+
getSQLType() {
|
|
24
|
+
return `geography${this.type || this.srid ? `(${this.type ?? ""}${this.srid ? this.type ? `,${this.srid}` : this.srid : ""})` : ""}`;
|
|
25
|
+
}
|
|
26
|
+
mapFromDriverValue(value) {
|
|
27
|
+
return parseEWKB(value);
|
|
28
|
+
}
|
|
29
|
+
mapToDriverValue(value) {
|
|
30
|
+
return `point(${value[0]} ${value[1]})`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
class PgGeographyObjectBuilder extends PgColumnBuilder {
|
|
34
|
+
static [entityKind] = "PgGeographyObjectBuilder";
|
|
35
|
+
constructor(name, config) {
|
|
36
|
+
super(name, "json", "PgGeographyObject");
|
|
37
|
+
this.config.srid = config?.srid;
|
|
38
|
+
this.config.type = config?.type;
|
|
39
|
+
}
|
|
40
|
+
/** @internal */
|
|
41
|
+
build(table) {
|
|
42
|
+
return new PgGeographyObject(
|
|
43
|
+
table,
|
|
44
|
+
this.config
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
class PgGeographyObject extends PgColumn {
|
|
49
|
+
static [entityKind] = "PgGeographyObject";
|
|
50
|
+
type = this.config.type;
|
|
51
|
+
srid = this.config.srid;
|
|
52
|
+
getSQLType() {
|
|
53
|
+
return `geography${this.type || this.srid ? `(${this.type ?? ""}${this.srid ? this.type ? `,${this.srid}` : this.srid : ""})` : ""}`;
|
|
54
|
+
}
|
|
55
|
+
mapFromDriverValue(value) {
|
|
56
|
+
const parsed = parseEWKB(value);
|
|
57
|
+
return { x: parsed[0], y: parsed[1] };
|
|
58
|
+
}
|
|
59
|
+
mapToDriverValue(value) {
|
|
60
|
+
return `geography(${value.x} ${value.y})`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function geography(name, config) {
|
|
64
|
+
if (!config?.mode || config.mode === "tuple") {
|
|
65
|
+
return new PgGeographyBuilder(name, config);
|
|
66
|
+
}
|
|
67
|
+
return new PgGeographyObjectBuilder(name, config);
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
PgGeography,
|
|
71
|
+
PgGeographyBuilder,
|
|
72
|
+
PgGeographyObject,
|
|
73
|
+
PgGeographyObjectBuilder,
|
|
74
|
+
geography
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=geography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/pg-core/columns/postgis_extension/geography.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyPgTable } from '~/pg-core/table.ts';\n\nimport type { Equal } from '~/utils.ts';\nimport { PgColumn, PgColumnBuilder } from '../common.ts';\nimport { parseEWKB } from './utils.ts';\n\nexport type PgGeographyBuilderInitial<TName extends string> = PgGeographyBuilder<{\n\tname: TName;\n\tdataType: 'array';\n\tcolumnType: 'PgGeography';\n\tdata: [number, number];\n\tdriverParam: string;\n\tenumValues: undefined;\n\tgenerated: undefined;\n}>;\n\nexport class PgGeographyBuilder<T extends ColumnBuilderBaseConfig<'array', 'PgGeography'>>\n\textends PgColumnBuilder<T, { type: PgGeographyConfig['type']; srid: PgGeographyConfig['srid'] }>\n{\n\tstatic override readonly [entityKind]: string = 'PgGeographyBuilder';\n\n\tconstructor(name: T['name'], config?: PgGeographyConfig) {\n\t\tsuper(name, 'array', 'PgGeography');\n\t\tthis.config.srid = config?.srid;\n\t\tthis.config.type = config?.type;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgGeography<MakeColumnConfig<T, TTableName>> {\n\t\treturn new PgGeography<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class PgGeography<T extends ColumnBaseConfig<'array', 'PgGeography'>>\n\textends PgColumn<T, { type: PgGeographyConfig['type']; srid: PgGeographyConfig['srid'] }>\n{\n\tstatic override readonly [entityKind]: string = 'PgGeography';\n\n\treadonly type = this.config.type;\n\treadonly srid = this.config.srid;\n\n\tgetSQLType(): string {\n\t\treturn `geography${\n\t\t\tthis.type || this.srid ? `(${this.type ?? ''}${this.srid ? this.type ? `,${this.srid}` : this.srid : ''})` : ''\n\t\t}`;\n\t}\n\n\toverride mapFromDriverValue(value: string): [number, number] {\n\t\treturn parseEWKB(value);\n\t}\n\n\toverride mapToDriverValue(value: [number, number]): string {\n\t\treturn `point(${value[0]} ${value[1]})`;\n\t}\n}\n\nexport type PgGeographyObjectBuilderInitial<TName extends string> = PgGeographyObjectBuilder<{\n\tname: TName;\n\tdataType: 'json';\n\tcolumnType: 'PgGeographyObject';\n\tdata: { x: number; y: number };\n\tdriverParam: string;\n\tenumValues: undefined;\n\tgenerated: undefined;\n}>;\n\nexport class PgGeographyObjectBuilder<T extends ColumnBuilderBaseConfig<'json', 'PgGeographyObject'>>\n\textends PgColumnBuilder<T, { type: PgGeographyConfig['type']; srid: PgGeographyConfig['srid'] }>\n{\n\tstatic override readonly [entityKind]: string = 'PgGeographyObjectBuilder';\n\n\tconstructor(name: T['name'], config?: PgGeographyConfig) {\n\t\tsuper(name, 'json', 'PgGeographyObject');\n\t\tthis.config.srid = config?.srid;\n\t\tthis.config.type = config?.type;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgGeographyObject<MakeColumnConfig<T, TTableName>> {\n\t\treturn new PgGeographyObject<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class PgGeographyObject<T extends ColumnBaseConfig<'json', 'PgGeographyObject'>>\n\textends PgColumn<T, { type: PgGeographyConfig['type']; srid: PgGeographyConfig['srid'] }>\n{\n\tstatic override readonly [entityKind]: string = 'PgGeographyObject';\n\n\treadonly type = this.config.type;\n\treadonly srid = this.config.srid;\n\n\tgetSQLType(): string {\n\t\treturn `geography${\n\t\t\tthis.type || this.srid ? `(${this.type ?? ''}${this.srid ? this.type ? `,${this.srid}` : this.srid : ''})` : ''\n\t\t}`;\n\t}\n\n\toverride mapFromDriverValue(value: string): { x: number; y: number } {\n\t\tconst parsed = parseEWKB(value);\n\t\treturn { x: parsed[0], y: parsed[1] };\n\t}\n\n\toverride mapToDriverValue(value: { x: number; y: number }): string {\n\t\treturn `geography(${value.x} ${value.y})`;\n\t}\n}\n\ninterface PgGeographyConfig<T extends 'tuple' | 'xy' = 'tuple' | 'xy'> {\n\tmode?: T;\n\ttype?: 'point' | (string & {});\n\tsrid?: number;\n}\n\nexport function geography<TName extends string, TMode extends PgGeographyConfig['mode'] & {}>(\n\tname: TName,\n\tconfig?: PgGeographyConfig<TMode>,\n): Equal<TMode, 'xy'> extends true ? PgGeographyObjectBuilderInitial<TName>\n\t: PgGeographyBuilderInitial<TName>;\nexport function geography(name: string, config?: PgGeographyConfig) {\n\tif (!config?.mode || config.mode === 'tuple') {\n\t\treturn new PgGeographyBuilder(name, config);\n\t}\n\treturn new PgGeographyObjectBuilder(name, config);\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAI3B,SAAS,UAAU,uBAAuB;AAC1C,SAAS,iBAAiB;AAYnB,MAAM,2BACJ,gBACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAA4B;AACxD,UAAM,MAAM,SAAS,aAAa;AAClC,SAAK,OAAO,OAAO,QAAQ;AAC3B,SAAK,OAAO,OAAO,QAAQ;AAAA,EAC5B;AAAA;AAAA,EAGS,MACR,OAC+C;AAC/C,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,oBACJ,SACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEvC,OAAO,KAAK,OAAO;AAAA,EACnB,OAAO,KAAK,OAAO;AAAA,EAE5B,aAAqB;AACpB,WAAO,YACN,KAAK,QAAQ,KAAK,OAAO,IAAI,KAAK,QAAQ,EAAE,GAAG,KAAK,OAAO,KAAK,OAAO,IAAI,KAAK,IAAI,KAAK,KAAK,OAAO,EAAE,MAAM,EAC9G;AAAA,EACD;AAAA,EAES,mBAAmB,OAAiC;AAC5D,WAAO,UAAU,KAAK;AAAA,EACvB;AAAA,EAES,iBAAiB,OAAiC;AAC1D,WAAO,SAAS,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA,EACrC;AACD;AAYO,MAAM,iCACJ,gBACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAA4B;AACxD,UAAM,MAAM,QAAQ,mBAAmB;AACvC,SAAK,OAAO,OAAO,QAAQ;AAC3B,SAAK,OAAO,OAAO,QAAQ;AAAA,EAC5B;AAAA;AAAA,EAGS,MACR,OACqD;AACrD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,0BACJ,SACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEvC,OAAO,KAAK,OAAO;AAAA,EACnB,OAAO,KAAK,OAAO;AAAA,EAE5B,aAAqB;AACpB,WAAO,YACN,KAAK,QAAQ,KAAK,OAAO,IAAI,KAAK,QAAQ,EAAE,GAAG,KAAK,OAAO,KAAK,OAAO,IAAI,KAAK,IAAI,KAAK,KAAK,OAAO,EAAE,MAAM,EAC9G;AAAA,EACD;AAAA,EAES,mBAAmB,OAAyC;AACpE,UAAM,SAAS,UAAU,KAAK;AAC9B,WAAO,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,EAAE;AAAA,EACrC;AAAA,EAES,iBAAiB,OAAyC;AAClE,WAAO,aAAa,MAAM,CAAC,IAAI,MAAM,CAAC;AAAA,EACvC;AACD;AAaO,SAAS,UAAU,MAAc,QAA4B;AACnE,MAAI,CAAC,QAAQ,QAAQ,OAAO,SAAS,SAAS;AAC7C,WAAO,IAAI,mBAAmB,MAAM,MAAM;AAAA,EAC3C;AACA,SAAO,IAAI,yBAAyB,MAAM,MAAM;AACjD;","names":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name2 in all)
|
|
8
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var name_exports = {};
|
|
20
|
+
__export(name_exports, {
|
|
21
|
+
PgNameInternal: () => PgNameInternal,
|
|
22
|
+
PgNameInternalBuilder: () => PgNameInternalBuilder,
|
|
23
|
+
name: () => name
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(name_exports);
|
|
26
|
+
var import_entity = require("../../../entity.cjs");
|
|
27
|
+
var import_common = require("../common.cjs");
|
|
28
|
+
class PgNameInternalBuilder extends import_common.PgColumnBuilder {
|
|
29
|
+
static [import_entity.entityKind] = "PgNameInternalBuilder";
|
|
30
|
+
constructor(name2) {
|
|
31
|
+
super(name2, "string", "PgNameInternal");
|
|
32
|
+
}
|
|
33
|
+
/** @internal */
|
|
34
|
+
build(table) {
|
|
35
|
+
return new PgNameInternal(
|
|
36
|
+
table,
|
|
37
|
+
this.config
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
class PgNameInternal extends import_common.PgColumn {
|
|
42
|
+
static [import_entity.entityKind] = "PgNameInternal";
|
|
43
|
+
getSQLType() {
|
|
44
|
+
return `name`;
|
|
45
|
+
}
|
|
46
|
+
mapFromDriverValue(value) {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
mapToDriverValue(value) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function name(name2) {
|
|
54
|
+
return new PgNameInternalBuilder(name2 ?? "");
|
|
55
|
+
}
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
PgNameInternal,
|
|
59
|
+
PgNameInternalBuilder,
|
|
60
|
+
name
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=name.cjs.map
|