drizzle-orm 0.10.40 → 0.10.41

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.
@@ -22,6 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
+ /* eslint-disable no-continue */
25
26
  /* eslint-disable no-restricted-syntax */
26
27
  /* eslint-disable import/export */
27
28
  /* eslint-disable max-classes-per-file */
@@ -72,6 +73,9 @@ class Migrator {
72
73
  await transaction.begin();
73
74
  try {
74
75
  for await (const migrationFolder of files) {
76
+ if (migrationFolder === '.DS_Store') {
77
+ continue;
78
+ }
75
79
  const migrationFiles = fs.readdirSync(`${migrationFolderTo}/${migrationFolder}`);
76
80
  const migrationFile = migrationFiles.filter((file) => file === 'migration.sql')[0];
77
81
  const query = fs.readFileSync(`${migrationFolderTo}/${migrationFolder}/${migrationFile}`).toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-orm",
3
- "version": "0.10.40",
3
+ "version": "0.10.41",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/test.d.ts CHANGED
@@ -0,0 +1 @@
1
+ export {};
package/test.js CHANGED
@@ -1,66 +1,67 @@
1
1
  "use strict";
2
- // import DbConnector from './db/dbConnector';
3
- // import UsersTable from './docs/tables/usersTable';
4
- // import ConsoleLogger from './logger/consoleLogger';
5
- // import MigrationSerializer from './serializer/serializer';
6
- // import AbstractTable from './tables/abstractTable';
7
- // import {
8
- // ExtractColumnType, ExtractColumnType1,
9
- // } from './tables/inferTypes';
10
- // (async () => {
11
- // try {
12
- // const db = await new DbConnector()
13
- // .connectionString('postgresql://postgres@127.0.0.1/migrator')
14
- // .connect();
15
- // db.useLogger(new ConsoleLogger());
16
- // const usersTable = new UsersTable(db);
17
- // type g = ReturnType<typeof usersTable.updatedAt.getColumnType>['codeType'];
18
- // type f = ExtractColumnType<typeof usersTable.updatedAt>;
19
- // type f1 = ExtractColumnType1<f>;
20
- // // const citiesTable = new CitiesTable(db);
21
- // // await usersTable.insert({
22
- // // });
23
- // // const res = await citiesTable.update()
24
- // // // .groupBy((table, join1, join2, join3) => [table.id, join1.id, join1.phone])
25
- // // .where(eq(citiesTable.location, 'YR'))
26
- // // .set({
27
- // // metadata: [{
28
- // // fallback_image: true,
29
- // // team_image: 'https://files.slack.com/files-pri/T016CCC3FE3-F03461UR9M5/clinic_team_photo_1.jpg?pub_secret=560c098bfb',
30
- // // image_alt_text: 'Generic Physiotherapy Clinic image 1',
31
- // // logo: '',
32
- // // logo_alt_text: ''
33
- // // }],
34
- // // })
35
- // // // .leftJoin(CitiesTable, UsersTable, (table) => table.userId, (table) => table.id)
36
- // // // .leftJoin(UsersTable, UsersTable, (table) => table.id, (table) => table.id)
37
- // // .execute();
38
- // // console.log(res);
39
- // const ser = new MigrationSerializer();
40
- // const res = ser.generate([usersTable as AbstractTable<UsersTable>], []);
41
- // console.log(JSON.stringify(res, null, 2));
42
- // // const f = {
43
- // // id: count(usersTable.id),
44
- // // };
45
- // // type d = ExtractModel<typeof f>;
46
- // // const res = await usersTable.select()
47
- // // .leftJoin(UsersTable, (table) => table.id, (table) => table.id)
48
- // // .leftJoin(UsersTable, CitiesTable, (table) => table.id, (table) => table.id)
49
- // // .execute();
50
- // // const res = await usersTable.select()
51
- // // // .groupBy((table, join1, join2, join3) => [table.id, join1.id, join1.phone])
52
- // // .leftJoin(UsersTable, (table) => table.foundationDate, (table) => table.id)
53
- // // .leftJoin(UsersTable, UsersTable, (table) => table.role, (table) => table.id)
54
- // // .leftJoin(UsersTable, UsersTable, (table) => table.role, (table) => table.id)
55
- // // // .groupBy({
56
- // // // usersTable: usersTable.id,
57
- // // // firstJoin: [usersTable.id],
58
- // // // secondJoin: usersTable.id,
59
- // // // thirdJoin: usersTable.id,
60
- // // // })
61
- // // .execute();
62
- // // console.log(res);
63
- // } catch (e) {
64
- // console.log(e);
65
- // }
66
- // })();
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const _1 = require(".");
7
+ const dbConnector_1 = __importDefault(require("./db/dbConnector"));
8
+ const consoleLogger_1 = __importDefault(require("./logger/consoleLogger"));
9
+ (async () => {
10
+ try {
11
+ const db = await new dbConnector_1.default()
12
+ .connectionString('postgresql://postgres@127.0.0.1/migrator')
13
+ .connect();
14
+ db.useLogger(new consoleLogger_1.default());
15
+ // const usersTable = new UsersTable(db);
16
+ _1.drizzle.migrator(db).migrate({ migrationFolder: 'drizzle' });
17
+ // type g = ReturnType<typeof usersTable.updatedAt.getColumnType>['codeType'];
18
+ // type f = ExtractColumnType<typeof usersTable.updatedAt>;
19
+ // type f1 = ExtractColumnType1<f>;
20
+ // const citiesTable = new CitiesTable(db);
21
+ // await usersTable.insert({
22
+ // });
23
+ // const res = await citiesTable.update()
24
+ // // .groupBy((table, join1, join2, join3) => [table.id, join1.id, join1.phone])
25
+ // .where(eq(citiesTable.location, 'YR'))
26
+ // .set({
27
+ // metadata: [{
28
+ // fallback_image: true,
29
+ // team_image: 'https://files.slack.com/files-pri/T016CCC3FE3-F03461UR9M5/clinic_team_photo_1.jpg?pub_secret=560c098bfb',
30
+ // image_alt_text: 'Generic Physiotherapy Clinic image 1',
31
+ // logo: '',
32
+ // logo_alt_text: ''
33
+ // }],
34
+ // })
35
+ // // .leftJoin(CitiesTable, UsersTable, (table) => table.userId, (table) => table.id)
36
+ // // .leftJoin(UsersTable, UsersTable, (table) => table.id, (table) => table.id)
37
+ // .execute();
38
+ // console.log(res);
39
+ // const ser = new MigrationSerializer();
40
+ // const res = ser.generate([usersTable as AbstractTable<UsersTable>], []);
41
+ // console.log(JSON.stringify(res, null, 2));
42
+ // const f = {
43
+ // id: count(usersTable.id),
44
+ // };
45
+ // type d = ExtractModel<typeof f>;
46
+ // const res = await usersTable.select()
47
+ // .leftJoin(UsersTable, (table) => table.id, (table) => table.id)
48
+ // .leftJoin(UsersTable, CitiesTable, (table) => table.id, (table) => table.id)
49
+ // .execute();
50
+ // const res = await usersTable.select()
51
+ // // .groupBy((table, join1, join2, join3) => [table.id, join1.id, join1.phone])
52
+ // .leftJoin(UsersTable, (table) => table.foundationDate, (table) => table.id)
53
+ // .leftJoin(UsersTable, UsersTable, (table) => table.role, (table) => table.id)
54
+ // .leftJoin(UsersTable, UsersTable, (table) => table.role, (table) => table.id)
55
+ // // .groupBy({
56
+ // // usersTable: usersTable.id,
57
+ // // firstJoin: [usersTable.id],
58
+ // // secondJoin: usersTable.id,
59
+ // // thirdJoin: usersTable.id,
60
+ // // })
61
+ // .execute();
62
+ // console.log(res);
63
+ }
64
+ catch (e) {
65
+ console.log(e);
66
+ }
67
+ })();