drizzle-orm
Advanced tools
Comparing version 0.10.1 to 0.10.2
@@ -22,3 +22,3 @@ import { PgTime, PgTimestamp } from '.'; | ||
protected defaultParam: any; | ||
protected referenced: AbstractColumn<T, boolean, boolean>; | ||
protected referenced: AbstractColumn<T, boolean, boolean, TParent>; | ||
constructor(parent: TParent, columnName: string, columnType: T); | ||
@@ -32,3 +32,3 @@ getOnDelete: () => string | undefined; | ||
new (db: DB): ITable; | ||
}, callback: (table: ITable) => AbstractColumn<T, boolean, boolean>, onConstraint: { | ||
}, callback: (table: ITable) => AbstractColumn<T, boolean, boolean, TParent>, onConstraint: { | ||
onDelete?: 'CASCADE' | 'RESTRICT' | 'SET NULL' | 'SET DEFAULT'; | ||
@@ -38,7 +38,7 @@ onUpdate?: 'CASCADE' | 'RESTRICT' | 'SET NULL' | 'SET DEFAULT'; | ||
defaultValue: (value: ExtractColumnType<T>) => this; | ||
abstract primaryKey(): AbstractColumn<T, boolean, boolean>; | ||
abstract primaryKey(): AbstractColumn<T, boolean, boolean, TParent>; | ||
unique: () => this; | ||
abstract notNull(): AbstractColumn<T, boolean, boolean>; | ||
abstract notNull(): AbstractColumn<T, boolean, boolean, TParent>; | ||
getColumnName: () => string; | ||
getReferenced: () => AbstractColumn<T, boolean, boolean>; | ||
getReferenced: () => AbstractColumn<T, boolean, boolean, TParent>; | ||
getColumnType: () => T; | ||
@@ -45,0 +45,0 @@ getDefaultValue: () => any; |
{ | ||
"name": "drizzle-orm", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -41,6 +41,18 @@ "use strict"; | ||
primaryKey: !!value.primaryKeyName, | ||
unique: !!value.uniqueKeyName, | ||
// unique: !!value.uniqueKeyName, | ||
default: value.getDefaultValue() === null ? undefined : value.getDefaultValue(), | ||
notNull: !value.isNullableFlag, | ||
}; | ||
if (value.uniqueKeyName) { | ||
const indexName = `${value.getParent().tableName()}_${value.getColumnName()}_index`; | ||
const indexColumnToReturn = {}; | ||
indexColumnToReturn[value.getColumnName()] = { | ||
name: value.getColumnName(), | ||
}; | ||
indexToReturn[indexName] = { | ||
name: indexName, | ||
columns: indexColumnToReturn, | ||
isUnique: true, | ||
}; | ||
} | ||
const referenced = value.getReferenced(); | ||
@@ -47,0 +59,0 @@ if (referenced) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const _1 = require("."); | ||
const citiesTable_1 = require("./docs/tables/citiesTable"); | ||
const usersTable_1 = require("./docs/tables/usersTable"); | ||
const usersToUserGroups_1 = require("./docs/tables/usersToUserGroups"); | ||
@@ -27,3 +29,5 @@ const consoleLogger_1 = require("./logger/consoleLogger"); | ||
db.useLogger(new consoleLogger_1.default()); | ||
const table = new usersToUserGroups_1.default(db); | ||
const table = new usersTable_1.default(db); | ||
const cities = new citiesTable_1.default(db); | ||
const d = new usersToUserGroups_1.default(db); | ||
const serializer = new serializer_1.default(); | ||
@@ -30,0 +34,0 @@ const res = serializer.generate([table], []); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
261794
5359