File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,12 @@ export type ShallowDehydrateValue<T> = T extends null | undefined
250250 ? never
251251 : string )
252252
253- export type StringsWhenDataTypeNotAvailable = Date | Buffer | ArrayBuffer
253+ export type StringsWhenDataTypeNotAvailable =
254+ | Date
255+ // Many Node.js drivers return `Buffer` by default for some column data types.
256+ // Buffer is a subclass of `Uint8Array`. `Buffer` doesn't exist in non-Node TypeScript
257+ // environments - and results in `any` or a compilation error if used.
258+ | Uint8Array
254259
255260export type NumbersWhenDataTypeNotAvailable = bigint | NumericString
256261
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ async function testPostgresJsonSelects(db: Kysely<Database>) {
4646 modified_at : eb . ref ( 'modified_at' ) ,
4747 people_with_same_name_by_2050 : sql < bigint > `custom_function(first_name)` ,
4848 people_with_same_name_by_2050_str : sql < NumericString > `custom_function(first_name)::text` ,
49+ binary_thing : sql < Buffer > `another_custom_function()` ,
4950 } ) . as ( 'name' ) ,
5051
5152 // Nest other people with same first name.
@@ -90,6 +91,7 @@ async function testPostgresJsonSelects(db: Kysely<Database>) {
9091 modified_at : string
9192 people_with_same_name_by_2050 : number
9293 people_with_same_name_by_2050_str : number
94+ binary_thing : string
9395 }
9496 people_same_first_name : {
9597 id : number
You can’t perform that action at this time.
0 commit comments