-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzapatos_utils.mjs
53 lines (48 loc) · 1.13 KB
/
zapatos_utils.mjs
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
import { generate } from "zapatos/generate";
// since pg is mapped to @neondatabase/serverless, we need to provide a
// WebSocket implementation when we're running on Node.js
// import ws from 'ws';
// import { neonConfig } from '@neondatabase/serverless';
// neonConfig.webSocketConstructor = ws;
import { config } from "dotenv";
// generate({
// db: { connectionString: process.env.DATABASE_URL },
// schemas: {
// public: {
// include: "*",
// exclude: [
// "geography_columns",
// "geometry_columns",
// "raster_columns",
// "raster_overviews",
// "spatial_ref_sys"
// ]
// }
// }
// });
config();
export const ZAPATOS_CONFIG = {
db: {
connectionString: process.env.POSTGRES_URL,
},
schemas: {
public: {
include: "*",
exclude: [
"geography_columns",
"geometry_columns",
"raster_columns",
"raster_overviews",
"spatial_ref_sys",
],
},
},
outDir: ".",
customTypesTransform: "PgMyType",
};
export const initDB = () => {
console.log("generating zapatos");
generate(ZAPATOS_CONFIG).then(() => {
console.log("generated zapatos");
});
};