drizzle-orm 0.10.42 → 0.10.45
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/README.md +439 -0
- package/builders/highLvlBuilders/selectRequestBuilder.js +4 -4
- package/builders/joinBuilders/builders/abstractJoinBuilder.d.ts +3 -1
- package/builders/joinBuilders/builders/abstractJoinBuilder.js +6 -1
- package/builders/joinBuilders/builders/selectWithFiveJoins.d.ts +2 -1
- package/builders/joinBuilders/builders/selectWithFiveJoins.js +2 -2
- package/builders/joinBuilders/builders/selectWithFourJoins.d.ts +2 -1
- package/builders/joinBuilders/builders/selectWithFourJoins.js +6 -6
- package/builders/joinBuilders/builders/selectWithJoin.d.ts +2 -1
- package/builders/joinBuilders/builders/selectWithJoin.js +6 -6
- package/builders/joinBuilders/builders/selectWithThreeJoins.d.ts +2 -1
- package/builders/joinBuilders/builders/selectWithThreeJoins.js +6 -6
- package/builders/joinBuilders/builders/selectWithTwoJoins.d.ts +2 -1
- package/builders/joinBuilders/builders/selectWithTwoJoins.js +6 -6
- package/columns/types/pgJsonb.js +1 -1
- package/columns/types/pgText.js +1 -1
- package/columns/types/pgVarChar.js +1 -1
- package/db/session.d.ts +3 -2
- package/db/session.js +13 -3
- package/package.json +7 -4
- package/test.d.ts +1 -0
- package/test.js +103 -103
- package/.pnpm-debug.log +0 -16
- package/data/citiesTable.d.ts +0 -9
- package/data/citiesTable.js +0 -22
- package/data/userGroupsTable.d.ts +0 -7
- package/data/userGroupsTable.js +0 -15
- package/data/usersTable.d.ts +0 -17
- package/data/usersTable.js +0 -31
- package/data/usersToUserGroups.d.ts +0 -7
- package/data/usersToUserGroups.js +0 -20
package/data/usersTable.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable max-classes-per-file */
|
|
3
|
-
// import { Defaults } from '../../columns/column';
|
|
4
|
-
// import { rolesEnum } from '../types/rolesType';
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.rolesEnum = void 0;
|
|
7
|
-
const __1 = require("..");
|
|
8
|
-
const type_1 = require("../types/type");
|
|
9
|
-
exports.rolesEnum = type_1.createEnum({ alias: 'test-enum', values: ['foo', 'bar', 'baz'] });
|
|
10
|
-
class UsersTable extends __1.AbstractTable {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.id = this.serial('id').primaryKey();
|
|
14
|
-
this.fullName = this.text('full_name');
|
|
15
|
-
this.phone = this.varchar('phone', { size: 256 });
|
|
16
|
-
this.media = this.jsonb('media');
|
|
17
|
-
this.decimalField = this.decimal('test', { precision: 100, scale: 2 }).notNull();
|
|
18
|
-
this.bigIntField = this.bigint('test1', 'max_bytes_53');
|
|
19
|
-
this.role = this.type(exports.rolesEnum, 'name_in_table').notNull();
|
|
20
|
-
this.createdAt = this.timestamp('created_at').notNull();
|
|
21
|
-
// public createdAtWithTimezone = this.timestamptz('created_at');
|
|
22
|
-
this.updatedAt = this.timestamp('updated_at').defaultValue(__1.Defaults.CURRENT_TIMESTAMP);
|
|
23
|
-
this.isArchived = this.bool('is_archived').defaultValue(false);
|
|
24
|
-
this.phoneFullNameIndex = this.index([this.phone, this.fullName]);
|
|
25
|
-
this.phoneIndex = this.uniqueIndex(this.phone);
|
|
26
|
-
}
|
|
27
|
-
tableName() {
|
|
28
|
-
return 'users';
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.default = UsersTable;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AbstractTable } from '..';
|
|
2
|
-
export default class UsersToUserGroupsTable extends AbstractTable<UsersToUserGroupsTable> {
|
|
3
|
-
groupId: import("..").Column<import("..").PgInteger, true, false, this>;
|
|
4
|
-
userId: import("..").Column<import("..").PgInteger, true, false, this>;
|
|
5
|
-
manyToManyIndex: import("../indexes/tableIndex").default;
|
|
6
|
-
tableName(): string;
|
|
7
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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 userGroupsTable_1 = __importDefault(require("./userGroupsTable"));
|
|
8
|
-
const usersTable_1 = __importDefault(require("./usersTable"));
|
|
9
|
-
class UsersToUserGroupsTable extends __1.AbstractTable {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.groupId = this.int('city_id').foreignKey(userGroupsTable_1.default, (table) => table.id, { onDelete: 'CASCADE' });
|
|
13
|
-
this.userId = this.int('user_id').foreignKey(usersTable_1.default, (table) => table.id, { onDelete: 'CASCADE' });
|
|
14
|
-
this.manyToManyIndex = this.index([this.groupId, this.userId]);
|
|
15
|
-
}
|
|
16
|
-
tableName() {
|
|
17
|
-
return 'users_to_user_groups';
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.default = UsersToUserGroupsTable;
|