Skip to content

Commit

Permalink
Merge pull request #56 from duckdb/jray/literal-bigint-types
Browse files Browse the repository at this point in the history
add explicit types to avoid literal bigint types in d.ts files
  • Loading branch information
jraymakers authored Dec 10, 2024
2 parents cb5be3d + 8ea32ce commit 48bbf87
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions api/src/DuckDBType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export class DuckDBBigIntType extends BaseDuckDBType<DuckDBTypeId.BIGINT> {
public static create(alias?: string): DuckDBBigIntType {
return alias ? new DuckDBBigIntType(alias) : DuckDBBigIntType.instance;
}
public static readonly Max = 2n ** 63n - 1n;
public static readonly Min = -(2n ** 63n);
public static readonly Max: bigint = 2n ** 63n - 1n;
public static readonly Min: bigint = -(2n ** 63n);
}

export class DuckDBUTinyIntType extends BaseDuckDBType<DuckDBTypeId.UTINYINT> {
Expand Down Expand Up @@ -115,8 +115,8 @@ export class DuckDBUBigIntType extends BaseDuckDBType<DuckDBTypeId.UBIGINT> {
public static create(alias?: string): DuckDBUBigIntType {
return alias ? new DuckDBUBigIntType(alias) : DuckDBUBigIntType.instance;
}
public static readonly Max = 2n ** 64n - 1n;
public static readonly Min = 0n;
public static readonly Max: bigint = 2n ** 64n - 1n;
public static readonly Min: bigint = 0n;
}

export class DuckDBFloatType extends BaseDuckDBType<DuckDBTypeId.FLOAT> {
Expand Down Expand Up @@ -194,8 +194,8 @@ export class DuckDBHugeIntType extends BaseDuckDBType<DuckDBTypeId.HUGEINT> {
public static create(alias?: string): DuckDBHugeIntType {
return alias ? new DuckDBHugeIntType(alias) : DuckDBHugeIntType.instance;
}
public static readonly Max = 2n ** 127n - 1n;
public static readonly Min = -(2n ** 127n);
public static readonly Max: bigint = 2n ** 127n - 1n;
public static readonly Min: bigint = -(2n ** 127n);
}

export class DuckDBUHugeIntType extends BaseDuckDBType<DuckDBTypeId.UHUGEINT> {
Expand All @@ -206,8 +206,8 @@ export class DuckDBUHugeIntType extends BaseDuckDBType<DuckDBTypeId.UHUGEINT> {
public static create(alias?: string): DuckDBUHugeIntType {
return alias ? new DuckDBUHugeIntType(alias) : DuckDBUHugeIntType.instance;
}
public static readonly Max = 2n ** 128n - 1n;
public static readonly Min = 0n;
public static readonly Max: bigint = 2n ** 128n - 1n;
public static readonly Min: bigint = 0n;
}

export class DuckDBVarCharType extends BaseDuckDBType<DuckDBTypeId.VARCHAR> {
Expand Down

0 comments on commit 48bbf87

Please sign in to comment.