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

drizzle-orm-pg

Package Overview
Dependencies
Maintainers
3
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drizzle-orm-pg - npm Package Compare versions

Comparing version 0.12.0-beta.13 to 0.12.0-beta.14

columns/bigserial.d.ts

2

checks.d.ts

@@ -19,3 +19,3 @@ import { TableName } from 'drizzle-orm/branded-types';

export declare type BuildCheck<T extends AnyCheckBuilder> = T extends CheckBuilder<infer TTableName> ? Check<TTableName> : never;
export declare type AnyConstraint = Check<TableName>;
export declare type AnyCheck = Check<TableName>;
export declare function check<TTableName extends TableName>(name: string, value: AnyPgSQL<TTableName>): CheckBuilder<TTableName>;
import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgBigInt53Builder<TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<number>, ColumnDriverParam<number | string>, TNotNull, THasDefault> {
}
export declare class PgBigInt53<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<number>, ColumnDriverParam<number | string>, TNotNull, THasDefault> {
export declare class PgBigInt53<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<number>, ColumnDriverParam<number | string>, TNotNull, THasDefault> {
brand: 'PgBigInt53';
getSQLType(): string;
mapFromDriverValue: (value: ColumnDriverParam<number | string>) => ColumnData<number>;
mapFromDriverValue(value: number | string): number;
}
export declare class PgBigInt64Builder<TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<bigint>, ColumnDriverParam<string>, TNotNull, THasDefault> {
}
export declare class PgBigInt64<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<bigint>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgBigInt64<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<bigint>, ColumnDriverParam<string>, TNotNull, THasDefault> {
brand: 'PgBigInt64';
getSQLType(): string;
mapFromDriverValue: (value: ColumnDriverParam<string>) => ColumnData<bigint>;
mapFromDriverValue(value: string): bigint;
}

@@ -17,0 +17,0 @@ interface PgBigIntConfig<T extends 'number' | 'bigint'> {

@@ -12,15 +12,12 @@ "use strict";

exports.PgBigInt53Builder = PgBigInt53Builder;
class PgBigInt53 extends common_1.PgColumnWithMapper {
constructor() {
super(...arguments);
this.mapFromDriverValue = (value) => {
if (typeof value === 'number') {
return value;
}
return parseInt(value);
};
}
class PgBigInt53 extends common_1.PgColumn {
getSQLType() {
return 'bigint';
}
mapFromDriverValue(value) {
if (typeof value === 'number') {
return value;
}
return parseInt(value);
}
}

@@ -35,12 +32,11 @@ exports.PgBigInt53 = PgBigInt53;

exports.PgBigInt64Builder = PgBigInt64Builder;
class PgBigInt64 extends common_1.PgColumnWithMapper {
constructor() {
super(...arguments);
this.mapFromDriverValue = (value) => {
return BigInt(value);
};
}
class Test {
}
class PgBigInt64 extends common_1.PgColumn {
getSQLType() {
return 'bigint';
}
mapFromDriverValue(value) {
return BigInt(value);
}
}

@@ -47,0 +43,0 @@ exports.PgBigInt64 = PgBigInt64;

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgBooleanBuilder<TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<boolean>, ColumnDriverParam<boolean>, TNotNull, THasDefault> {
}
export declare class PgBoolean<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<boolean>, ColumnDriverParam<boolean>, TNotNull, THasDefault> {
export declare class PgBoolean<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<boolean>, ColumnDriverParam<boolean>, TNotNull, THasDefault> {
protected brand: 'PgBoolean';

@@ -7,0 +7,0 @@ getSQLType(): string;

@@ -12,3 +12,3 @@ "use strict";

exports.PgBooleanBuilder = PgBooleanBuilder;
class PgBoolean extends common_1.PgColumnWithMapper {
class PgBoolean extends common_1.PgColumn {
getSQLType() {

@@ -15,0 +15,0 @@ return 'boolean';

@@ -25,14 +25,9 @@ import { Column } from 'drizzle-orm';

export declare type AnyPgColumnBuilder = PgColumnBuilder<any, any, any, any>;
export declare abstract class PgColumn<TTableName extends TableName<string>, TDataType extends ColumnData, TDriverData extends PgColumnDriverParam, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends Column<TTableName, TDataType, TDriverData, TNotNull, THasDefault> {
export declare abstract class PgColumn<TTableName extends TableName<string>, TData extends ColumnData, TDriverParam extends PgColumnDriverParam, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends Column<TTableName, TData, TDriverParam, TNotNull, THasDefault> {
readonly table: AnyPgTable<TTableName>;
constructor(table: AnyPgTable<TTableName>, builder: PgColumnBuilder<TDataType, TDriverData, TNotNull, THasDefault>);
constructor(table: AnyPgTable<TTableName>, builder: PgColumnBuilder<TData, TDriverParam, TNotNull, THasDefault>);
unsafe(): AnyPgColumn;
}
export declare abstract class PgColumnWithMapper<TTableName extends TableName, TData extends ColumnData, TDriverParam extends PgColumnDriverParam, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, TData, TDriverParam, TNotNull, THasDefault> {
mapFromDriverValue: (value: TDriverParam) => TData;
mapToDriverValue: (value: TData) => TDriverParam;
}
export declare type AnyPgColumn<TTableName extends TableName = any, TData extends ColumnData = any, TDriverParam extends PgColumnDriverParam = PgColumnDriverParam, TNotNull extends ColumnNotNull = any, THasDefault extends ColumnHasDefault = any> = PgColumn<TTableName, TData, TDriverParam, TNotNull, THasDefault>;
export declare type AnyPgColumnWithMapper<TTableName extends TableName = TableName, TData extends ColumnData = any, TDriverParam extends PgColumnDriverParam = PgColumnDriverParam, TNotNull extends ColumnNotNull = ColumnNotNull, THasDefault extends ColumnHasDefault = ColumnHasDefault> = PgColumnWithMapper<TTableName, TData, TDriverParam, TNotNull, THasDefault>;
export declare type BuildPgColumn<TTableName extends TableName, TBuilder extends AnyPgColumnBuilder> = TBuilder extends PgColumnBuilder<infer TData, infer TDriverParam, infer TNotNull, infer THasDefault> ? PgColumnWithMapper<TTableName, TData, TDriverParam, TNotNull, THasDefault> : never;
export declare type BuildPgColumn<TTableName extends TableName, TBuilder extends AnyPgColumnBuilder> = TBuilder extends PgColumnBuilder<infer TData, infer TDriverParam, infer TNotNull, infer THasDefault> ? PgColumn<TTableName, TData, TDriverParam, TNotNull, THasDefault> : never;
export declare type BuildPgColumns<TTableName extends TableName, TConfigMap extends Record<string, AnyPgColumnBuilder>> = Simplify<{

@@ -39,0 +34,0 @@ [Key in keyof TConfigMap]: BuildPgColumn<TTableName, TConfigMap[Key]>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PgColumnWithMapper = exports.PgColumn = exports.PgColumnBuilder = void 0;
exports.PgColumn = exports.PgColumnBuilder = void 0;
const drizzle_orm_1 = require("drizzle-orm");

@@ -21,13 +21,2 @@ const column_builder_1 = require("drizzle-orm/column-builder");

}
// references(
// arg: () => any,
// ): PgColumnBuilder<
// TData,
// TDriverParam,
// TNotNull,
// THasDefault
// > {
// this.foreignKeyConfigs.push({ ref, actions });
// return this;
// }
references(ref, actions = {}) {

@@ -65,14 +54,2 @@ this.foreignKeyConfigs.push({ ref, actions });

exports.PgColumn = PgColumn;
class PgColumnWithMapper extends PgColumn {
constructor() {
super(...arguments);
this.mapFromDriverValue = (value) => {
return value;
};
this.mapToDriverValue = (value) => {
return value;
};
}
}
exports.PgColumnWithMapper = PgColumnWithMapper;
//# sourceMappingURL=common.js.map
import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnWithMapper } from './common';
import { PgColumn } from './common';
import { PgDateColumnBaseBuilder } from './date.common';
export declare class PgDateBuilder<TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgDateColumnBaseBuilder<ColumnData<Date>, ColumnDriverParam<string>, TNotNull, THasDefault> {
}
export declare class PgDate<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<Date>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgDate<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<Date>, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgDate';

@@ -16,3 +16,3 @@ constructor(table: AnyPgTable<TTableName>, builder: PgDateBuilder<TNotNull, THasDefault>);

}
export declare class PgDateString<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<string>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgDateString<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<string>, ColumnDriverParam<string>, TNotNull, THasDefault> {
brand: 'PgDateString';

@@ -19,0 +19,0 @@ constructor(table: AnyPgTable<TTableName>, builder: PgDateStringBuilder<TNotNull, THasDefault>);

@@ -13,3 +13,3 @@ "use strict";

exports.PgDateBuilder = PgDateBuilder;
class PgDate extends common_1.PgColumnWithMapper {
class PgDate extends common_1.PgColumn {
constructor(table, builder) {

@@ -36,3 +36,3 @@ super(table, builder);

exports.PgDateStringBuilder = PgDateStringBuilder;
class PgDateString extends common_1.PgColumnWithMapper {
class PgDateString extends common_1.PgColumn {
constructor(table, builder) {

@@ -39,0 +39,0 @@ super(table, builder);

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgDoublePrecisionBuilder<TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<number>, ColumnDriverParam<string | number>, TNotNull, THasDefault> {
constructor(name: string, length?: number);
}
export declare class PgDoublePrecision<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<number>, ColumnDriverParam<string | number>, TNotNull, THasDefault> {
export declare class PgDoublePrecision<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<number>, ColumnDriverParam<string | number>, TNotNull, THasDefault> {
protected brand: 'PgDoublePrecision';

@@ -9,0 +9,0 @@ constructor(table: AnyPgTable<TTableName>, builder: PgDoublePrecisionBuilder<TNotNull, THasDefault>);

@@ -16,3 +16,3 @@ "use strict";

exports.PgDoublePrecisionBuilder = PgDoublePrecisionBuilder;
class PgDoublePrecision extends common_1.PgColumnWithMapper {
class PgDoublePrecision extends common_1.PgColumn {
constructor(table, builder) {

@@ -19,0 +19,0 @@ super(table, builder);

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export interface PgEnum<TValues extends string> {

@@ -12,3 +12,3 @@ readonly enumName: string;

}
export declare class PgEnumColumn<TTableName extends TableName, TData extends ColumnData<string>, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, TData, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgEnumColumn<TTableName extends TableName, TData extends ColumnData<string>, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, TData, ColumnDriverParam<string>, TNotNull, THasDefault> {
readonly enumName: string;

@@ -15,0 +15,0 @@ protected brand: 'PgEnumColumn';

@@ -22,3 +22,3 @@ "use strict";

exports.PgEnumColumnBuilder = PgEnumColumnBuilder;
class PgEnumColumn extends common_1.PgColumnWithMapper {
class PgEnumColumn extends common_1.PgColumn {
constructor(table, builder, enumName) {

@@ -25,0 +25,0 @@ super(table, builder);

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgIntegerBuilder<TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<number>, ColumnDriverParam<number | string>, TNotNull, THasDefault> {
}
export declare class PgInteger<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<number>, ColumnDriverParam<number | string>, TNotNull, THasDefault> {
export declare class PgInteger<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<number>, ColumnDriverParam<number | string>, TNotNull, THasDefault> {
protected brand: 'PgInteger';

@@ -7,0 +7,0 @@ getSQLType(): string;

@@ -12,3 +12,3 @@ "use strict";

exports.PgIntegerBuilder = PgIntegerBuilder;
class PgInteger extends common_1.PgColumnWithMapper {
class PgInteger extends common_1.PgColumn {
constructor() {

@@ -15,0 +15,0 @@ super(...arguments);

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
import { PrecisionLimit } from './timestamp';

@@ -9,3 +9,3 @@ export declare class PgIntervalBuilder<TData extends ColumnData<string> = ColumnData<string>, TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {

}
export declare class PgInterval<TTableName extends TableName, TData extends ColumnData<string>, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgInterval<TTableName extends TableName, TData extends ColumnData<string>, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgTime';

@@ -15,3 +15,2 @@ readonly config: IntervalConfig;

getSQLType(): string;
mapFromDriverValue: (value: ColumnDriverParam<string>) => ColumnData<TData>;
}

@@ -18,0 +17,0 @@ export interface IntervalConfig {

@@ -16,8 +16,5 @@ "use strict";

exports.PgIntervalBuilder = PgIntervalBuilder;
class PgInterval extends common_1.PgColumnWithMapper {
class PgInterval extends common_1.PgColumn {
constructor(table, builder) {
super(table, builder);
this.mapFromDriverValue = (value) => {
return value;
};
this.config = builder.config;

@@ -24,0 +21,0 @@ }

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgJsonBuilder<TData, TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
constructor(name: string);
}
export declare class PgJson<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault, TData> extends PgColumnWithMapper<TTableName, ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgJson<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault, TData> extends PgColumn<TTableName, ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgJson';
constructor(table: AnyPgTable<TTableName>, builder: PgJsonBuilder<TData, TNotNull, THasDefault>);
getSQLType(): string;
mapFromDriverValue: (value: ColumnDriverParam<string>) => ColumnData<TData>;
}
export declare function json<TData>(name: string): PgJsonBuilder<TData, ColumnNotNull<false>, ColumnHasDefault<false>>;

@@ -15,8 +15,5 @@ "use strict";

exports.PgJsonBuilder = PgJsonBuilder;
class PgJson extends common_1.PgColumnWithMapper {
class PgJson extends common_1.PgColumn {
constructor(table, builder) {
super(table, builder);
this.mapFromDriverValue = (value) => {
return value;
};
}

@@ -23,0 +20,0 @@ getSQLType() {

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgJsonbBuilder<TData, TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
constructor(name: string);
}
export declare class PgJsonb<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault, TData> extends PgColumnWithMapper<TTableName, ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgJsonb<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault, TData> extends PgColumn<TTableName, ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgJsonb';
constructor(table: AnyPgTable<TTableName>, builder: PgJsonbBuilder<TData, TNotNull, THasDefault>);
getSQLType(): string;
mapFromDriverValue: (value: ColumnDriverParam<string>) => ColumnData<TData>;
}
export declare function jsonb<TData = any>(name: string): PgJsonbBuilder<TData, ColumnNotNull<false>, ColumnHasDefault<false>>;

@@ -15,8 +15,5 @@ "use strict";

exports.PgJsonbBuilder = PgJsonbBuilder;
class PgJsonb extends common_1.PgColumnWithMapper {
class PgJsonb extends common_1.PgColumn {
constructor(table, builder) {
super(table, builder);
this.mapFromDriverValue = (value) => {
return value;
};
}

@@ -23,0 +20,0 @@ getSQLType() {

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgNumericBuilder<TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<string>, ColumnDriverParam<string>, TNotNull, THasDefault> {
constructor(name: string, precision?: number, scale?: number);
}
export declare class PgNumeric<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<string>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgNumeric<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<string>, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgNumeric';

@@ -9,0 +9,0 @@ precision: number | undefined;

@@ -17,3 +17,3 @@ "use strict";

exports.PgNumericBuilder = PgNumericBuilder;
class PgNumeric extends common_1.PgColumnWithMapper {
class PgNumeric extends common_1.PgColumn {
constructor(table, builder) {

@@ -20,0 +20,0 @@ super(table, builder);

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgRealBuilder<TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<ColumnData<number>, ColumnDriverParam<string | number>, TNotNull, THasDefault> {
constructor(name: string, length?: number);
}
export declare class PgReal<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<number>, ColumnDriverParam<string | number>, TNotNull, THasDefault> {
export declare class PgReal<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<number>, ColumnDriverParam<string | number>, TNotNull, THasDefault> {
protected brand: 'PgReal';

@@ -9,0 +9,0 @@ constructor(table: AnyPgTable<TTableName>, builder: PgRealBuilder<TNotNull, THasDefault>);

@@ -16,3 +16,3 @@ "use strict";

exports.PgRealBuilder = PgRealBuilder;
class PgReal extends common_1.PgColumnWithMapper {
class PgReal extends common_1.PgColumn {
constructor(table, builder) {

@@ -19,0 +19,0 @@ super(table, builder);

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgSerialBuilder extends PgColumnBuilder<ColumnData<number>, ColumnDriverParam<number>, ColumnNotNull<true>, ColumnHasDefault<true>> {
}
export declare class PgSerial<TTableName extends TableName> extends PgColumnWithMapper<TTableName, ColumnData<number>, ColumnDriverParam<number>, ColumnNotNull<true>, ColumnHasDefault<true>> {
export declare class PgSerial<TTableName extends TableName> extends PgColumn<TTableName, ColumnData<number>, ColumnDriverParam<number>, ColumnNotNull<true>, ColumnHasDefault<true>> {
protected brand: 'PgSerial';

@@ -7,0 +7,0 @@ getSQLType(): string;

@@ -12,3 +12,3 @@ "use strict";

exports.PgSerialBuilder = PgSerialBuilder;
class PgSerial extends common_1.PgColumnWithMapper {
class PgSerial extends common_1.PgColumn {
getSQLType() {

@@ -15,0 +15,0 @@ return 'serial';

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgTextBuilder<TData extends ColumnData<string> = ColumnData<string>, TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<TData, ColumnDriverParam<string>, TNotNull, THasDefault> {
}
export declare class PgText<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault, TData extends ColumnData<string>> extends PgColumnWithMapper<TTableName, TData, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgText<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault, TData extends ColumnData<string>> extends PgColumn<TTableName, TData, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgText';

@@ -8,0 +8,0 @@ constructor(table: AnyPgTable<TTableName>, builder: PgTextBuilder<TData, TNotNull, THasDefault>);

@@ -12,3 +12,3 @@ "use strict";

exports.PgTextBuilder = PgTextBuilder;
class PgText extends common_1.PgColumnWithMapper {
class PgText extends common_1.PgColumn {
constructor(table, builder) {

@@ -15,0 +15,0 @@ super(table, builder);

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnWithMapper } from './common';
import { PgColumn } from './common';
import { PgDateColumnBaseBuilder } from './date.common';

@@ -11,3 +11,3 @@ import { PrecisionLimit } from './timestamp';

}
export declare class PgTime<TTableName extends TableName, TData extends ColumnData<string>, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgTime<TTableName extends TableName, TData extends ColumnData<string>, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<TData>, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgTime';

@@ -18,3 +18,2 @@ readonly withTimezone: boolean;

getSQLType(): string;
mapFromDriverValue: (value: ColumnDriverParam<string>) => ColumnData<TData>;
}

@@ -21,0 +20,0 @@ export interface TimeConfig {

@@ -18,8 +18,5 @@ "use strict";

exports.PgTimeBuilder = PgTimeBuilder;
class PgTime extends common_1.PgColumnWithMapper {
class PgTime extends common_1.PgColumn {
constructor(table, builder) {
super(table, builder);
this.mapFromDriverValue = (value) => {
return value;
};
this.withTimezone = builder.withTimezone;

@@ -26,0 +23,0 @@ this.precision = builder.precision;

import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnWithMapper } from './common';
import { PgColumn } from './common';
import { PgDateColumnBaseBuilder } from './date.common';

@@ -10,3 +10,3 @@ export declare class PgTimestampBuilder<TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgDateColumnBaseBuilder<ColumnData<Date>, ColumnDriverParam<string>, TNotNull, THasDefault> {

}
export declare class PgTimestamp<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<Date>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgTimestamp<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<Date>, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgTimestamp';

@@ -24,3 +24,3 @@ readonly withTimezone: boolean;

}
export declare class PgTimestampString<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, ColumnData<string>, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgTimestampString<TTableName extends TableName, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, ColumnData<string>, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgTimestampString';

@@ -27,0 +27,0 @@ readonly withTimezone: boolean;

@@ -18,3 +18,3 @@ "use strict";

exports.PgTimestampBuilder = PgTimestampBuilder;
class PgTimestamp extends common_1.PgColumnWithMapper {
class PgTimestamp extends common_1.PgColumn {
constructor(table, builder) {

@@ -46,3 +46,3 @@ super(table, builder);

exports.PgTimestampStringBuilder = PgTimestampStringBuilder;
class PgTimestampString extends common_1.PgColumnWithMapper {
class PgTimestampString extends common_1.PgColumn {
constructor(table, builder) {

@@ -65,5 +65,4 @@ super(table, builder);

return new PgTimestampBuilder(name, (_b = config === null || config === void 0 ? void 0 : config.withTimezone) !== null && _b !== void 0 ? _b : false, config === null || config === void 0 ? void 0 : config.precision);
;
}
exports.timestamp = timestamp;
//# sourceMappingURL=timestamp.js.map
import { ColumnData, ColumnDriverParam, ColumnHasDefault, ColumnNotNull, TableName } from 'drizzle-orm/branded-types';
import { AnyPgTable } from '../table';
import { PgColumnBuilder, PgColumnWithMapper } from './common';
import { PgColumn, PgColumnBuilder } from './common';
export declare class PgVarcharBuilder<TData extends ColumnData<string> = ColumnData<string>, TNotNull extends ColumnNotNull = ColumnNotNull<false>, THasDefault extends ColumnHasDefault = ColumnHasDefault<false>> extends PgColumnBuilder<TData, ColumnDriverParam<string>, TNotNull, THasDefault> {
constructor(name: string, length?: number);
}
export declare class PgVarchar<TTableName extends TableName, TData extends ColumnData<string>, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumnWithMapper<TTableName, TData, ColumnDriverParam<string>, TNotNull, THasDefault> {
export declare class PgVarchar<TTableName extends TableName, TData extends ColumnData<string>, TNotNull extends ColumnNotNull, THasDefault extends ColumnHasDefault> extends PgColumn<TTableName, TData, ColumnDriverParam<string>, TNotNull, THasDefault> {
protected brand: 'PgVarchar';

@@ -9,0 +9,0 @@ length: number | undefined;

@@ -16,3 +16,3 @@ "use strict";

exports.PgVarcharBuilder = PgVarcharBuilder;
class PgVarchar extends common_1.PgColumnWithMapper {
class PgVarchar extends common_1.PgColumn {
constructor(table, builder) {

@@ -19,0 +19,0 @@ super(table, builder);

@@ -10,11 +10,12 @@ import { GetColumnData } from 'drizzle-orm';

import { PgDelete, PgInsert, PgSelect, PgUpdate } from './queries';
import { PgSQL } from './sql';
import { AnyPgTable, InferModel } from './table';
export declare type PgSelectFields<TTableName extends TableName> = {
[key: string]: SQLResponse<TTableName, ColumnData> | AnyPgColumn<TTableName>;
[key: string]: PgSQL<TTableName | TableName> | SQLResponse<TTableName | TableName, ColumnData> | AnyPgColumn<TTableName>;
};
export declare type PgSelectFieldsOrdered<TTableName extends TableName = TableName> = (Omit<SelectFieldsOrdered[number], 'column'> & {
column: AnyPgColumn<TTableName> | AnySQLResponse<TTableName>;
column: AnyPgColumn<TTableName> | PgSQL<TTableName | TableName> | AnySQLResponse<TTableName | TableName>;
})[];
export declare type SelectResultFields<TSelectedFields extends PgSelectFields<TableName>> = Simplify<{
[Key in keyof TSelectedFields & string]: TSelectedFields[Key] extends AnyPgColumn ? GetColumnData<TSelectedFields[Key]> : TSelectedFields[Key] extends SQLResponse<TableName, infer TDriverParam> ? Unwrap<TDriverParam> : never;
[Key in keyof TSelectedFields & string]: TSelectedFields[Key] extends AnyPgColumn ? GetColumnData<TSelectedFields[Key]> : TSelectedFields[Key] extends SQLResponse<TableName, infer TDriverParam> ? Unwrap<TDriverParam> : TSelectedFields[Key] extends PgSQL<TableName> ? unknown : never;
}>;

@@ -21,0 +22,0 @@ export declare class PgTableOperations<TTable extends AnyPgTable, TTableNamesMap extends Record<string, string>> {

{
"name": "drizzle-orm-pg",
"version": "0.12.0-beta.13",
"version": "0.12.0-beta.14",
"description": "Drizzle ORM package for PostgreSQL database",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,2 +0,2 @@

import { ColumnData } from 'drizzle-orm/branded-types';
import { ColumnData, TableName } from 'drizzle-orm/branded-types';
import { SQL } from 'drizzle-orm/sql';

@@ -10,3 +10,5 @@ import { GetTableName } from 'drizzle-orm/utils';

import { AnyPgTable, GetTableConflictConstraints, InferModel } from '../table';
import { Index } from '..';
import { PgUpdateSet } from './update';
declare type ConflictConstraint<TTableName extends TableName> = Index<TTableName, any, true> | Check<TTableName>;
export interface PgInsertConfig<TTable extends AnyPgTable> {

@@ -30,6 +32,7 @@ table: TTable;

returning<TSelectedFields extends PgSelectFields<GetTableName<TTable>>>(fields: TSelectedFields): Pick<PgInsert<TTable, SelectResultFields<TSelectedFields>[]>, 'getQuery' | 'execute'>;
onConflictDoNothing(target?: SQL<GetTableName<TTable>> | ((constraints: GetTableConflictConstraints<TTable>) => Check<GetTableName<TTable>>)): Pick<this, 'returning' | 'getQuery' | 'execute'>;
onConflictDoUpdate(target: SQL<GetTableName<TTable>> | ((constraints: GetTableConflictConstraints<TTable>) => Check<GetTableName<TTable>>), set: PgUpdateSet<TTable>): Pick<this, 'returning' | 'getQuery' | 'execute'>;
onConflictDoNothing(target?: SQL<GetTableName<TTable>> | ((constraints: GetTableConflictConstraints<TTable>) => ConflictConstraint<GetTableName<TTable>>)): Pick<this, 'returning' | 'getQuery' | 'execute'>;
onConflictDoUpdate(target: SQL<GetTableName<TTable>> | ((constraints: GetTableConflictConstraints<TTable>) => ConflictConstraint<GetTableName<TTable>>), set: PgUpdateSet<TTable>): Pick<this, 'returning' | 'getQuery' | 'execute'>;
getQuery(): PgPreparedQuery;
execute(): Promise<TReturn>;
}
export {};

@@ -65,3 +65,3 @@ import { TableName, Unwrap } from 'drizzle-orm/branded-types';

};
where(where: ((aliases: TAliases) => AnyPgSQL<TableName<keyof TAliases & string> | GetTableName<TTable>>) | AnyPgSQL<GetTableName<TTable>> | undefined): PickWhere<this>;
where(where: ((aliases: TAliases) => AnyPgSQL<TableName<TJoinedDBTableNames> | TableName<keyof TAliases & string> | GetTableName<TTable>>) | AnyPgSQL<TableName<TJoinedDBTableNames> | GetTableName<TTable>> | undefined): PickWhere<this>;
orderBy(columns: (joins: TAliases) => AnyPgSQL<TableName<TJoinedDBTableNames> | GetTableName<TTable>>[] | AnyPgSQL<TableName<TJoinedDBTableNames> | GetTableName<TTable>>): PickOrderBy<this>;

@@ -68,0 +68,0 @@ orderBy(...columns: AnyPgSQL<TableName<TJoinedDBTableNames> | GetTableName<TTable>>[]): PickOrderBy<this>;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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