Skip to content

Commit 993f551

Browse files
committed
sql bigint
1 parent ada0506 commit 993f551

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

runtimes/core/src/sqldb/val.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ impl ToSql for RowValue {
7070
_ => Err(format!("string not supported for column of type {}", ty).into()),
7171
},
7272

73-
PValue::BigInt(_bi) => {
74-
todo!()
75-
}
73+
PValue::BigInt(bi) => match *ty {
74+
Type::TEXT | Type::VARCHAR => bi.to_sql(ty, out),
75+
_ => Err(format!("bigint not supported for column of type {}", ty).into()),
76+
},
7677

7778
PValue::Number(num) => match *ty {
7879
Type::INT2 => {

runtimes/js/encore.dev/storage/sqldb/database.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ const driverName = "node-pg";
1919
export type Row = Record<string, any>;
2020

2121
/** Represents a type that can be used in query template literals */
22-
export type Primitive = string | number | boolean | Buffer | Date | null;
22+
export type Primitive =
23+
| string
24+
| number
25+
| bigint
26+
| boolean
27+
| Buffer
28+
| Date
29+
| null;
2330

2431
/**
2532
* Constructing a new database object will result in Encore provisioning a database with

0 commit comments

Comments
 (0)