Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drizzle-orm

Package Overview
Dependencies
Maintainers
2
Versions
925
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drizzle-orm - npm Package Compare versions

Comparing version 0.10.1 to 0.10.2

10

columns/column.d.ts

@@ -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], []);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc