@@ -16,8 +16,8 @@ import { fillPlaceholders, type Query } from '~/sql/sql.ts';
1616import { tracer } from '~/tracing.ts' ;
1717import { type Assume , mapResultRow } from '~/utils.ts' ;
1818
19- export class BunSQLPreparedQuery < T extends PreparedQueryConfig > extends PgPreparedQuery < T > {
20- static override readonly [ entityKind ] : string = 'BunSQLPreparedQuery ' ;
19+ export class BunSQLPGPreparedQuery < T extends PreparedQueryConfig > extends PgPreparedQuery < T > {
20+ static override readonly [ entityKind ] : string = 'BunSQLPGPreparedQuery ' ;
2121
2222 constructor (
2323 private client : SQL ,
@@ -102,17 +102,17 @@ export class BunSQLPreparedQuery<T extends PreparedQueryConfig> extends PgPrepar
102102 }
103103}
104104
105- export interface BunSQLSessionOptions {
105+ export interface BunSQLPGSessionOptions {
106106 logger ?: Logger ;
107107 cache ?: Cache ;
108108}
109109
110- export class BunSQLSession <
110+ export class BunSQLPGSession <
111111 TSQL extends SQL ,
112112 TFullSchema extends Record < string , unknown > ,
113113 TSchema extends TablesRelationalConfig ,
114- > extends PgSession < BunSQLQueryResultHKT , TFullSchema , TSchema > {
115- static override readonly [ entityKind ] : string = 'BunSQLSession ' ;
114+ > extends PgSession < BunSQLPGQueryResultHKT , TFullSchema , TSchema > {
115+ static override readonly [ entityKind ] : string = 'BunSQLPGSession ' ;
116116
117117 logger : Logger ;
118118 private cache : Cache ;
@@ -122,7 +122,7 @@ export class BunSQLSession<
122122 dialect : PgDialect ,
123123 private schema : RelationalSchemaConfig < TSchema > | undefined ,
124124 /** @internal */
125- readonly options : BunSQLSessionOptions = { } ,
125+ readonly options : BunSQLPGSessionOptions = { } ,
126126 ) {
127127 super ( dialect ) ;
128128 this . logger = options . logger ?? new NoopLogger ( ) ;
@@ -141,7 +141,7 @@ export class BunSQLSession<
141141 } ,
142142 cacheConfig ?: WithCacheConfig ,
143143 ) : PgPreparedQuery < T > {
144- return new BunSQLPreparedQuery (
144+ return new BunSQLPGPreparedQuery (
145145 this . client ,
146146 query . sql ,
147147 query . params ,
@@ -168,17 +168,17 @@ export class BunSQLSession<
168168 }
169169
170170 override transaction < T > (
171- transaction : ( tx : BunSQLTransaction < TFullSchema , TSchema > ) => Promise < T > ,
171+ transaction : ( tx : BunSQLPGTransaction < TFullSchema , TSchema > ) => Promise < T > ,
172172 config ?: PgTransactionConfig ,
173173 ) : Promise < T > {
174174 return this . client . begin ( async ( client ) => {
175- const session = new BunSQLSession < TransactionSQL , TFullSchema , TSchema > (
175+ const session = new BunSQLPGSession < TransactionSQL , TFullSchema , TSchema > (
176176 client ,
177177 this . dialect ,
178178 this . schema ,
179179 this . options ,
180180 ) ;
181- const tx = new BunSQLTransaction ( this . dialect , session , this . schema ) ;
181+ const tx = new BunSQLPGTransaction ( this . dialect , session , this . schema ) ;
182182 if ( config ) {
183183 await tx . setTransaction ( config ) ;
184184 }
@@ -187,38 +187,38 @@ export class BunSQLSession<
187187 }
188188}
189189
190- export class BunSQLTransaction <
190+ export class BunSQLPGTransaction <
191191 TFullSchema extends Record < string , unknown > ,
192192 TSchema extends TablesRelationalConfig ,
193- > extends PgTransaction < BunSQLQueryResultHKT , TFullSchema , TSchema > {
194- static override readonly [ entityKind ] : string = 'BunSQLTransaction ' ;
193+ > extends PgTransaction < BunSQLPGQueryResultHKT , TFullSchema , TSchema > {
194+ static override readonly [ entityKind ] : string = 'BunSQLPGTransaction ' ;
195195
196196 constructor (
197197 dialect : PgDialect ,
198198 /** @internal */
199- override readonly session : BunSQLSession < TransactionSQL | SavepointSQL , TFullSchema , TSchema > ,
199+ override readonly session : BunSQLPGSession < TransactionSQL | SavepointSQL , TFullSchema , TSchema > ,
200200 schema : RelationalSchemaConfig < TSchema > | undefined ,
201201 nestedIndex = 0 ,
202202 ) {
203203 super ( dialect , session , schema , nestedIndex ) ;
204204 }
205205
206206 override transaction < T > (
207- transaction : ( tx : BunSQLTransaction < TFullSchema , TSchema > ) => Promise < T > ,
207+ transaction : ( tx : BunSQLPGTransaction < TFullSchema , TSchema > ) => Promise < T > ,
208208 ) : Promise < T > {
209209 return ( this . session . client as TransactionSQL ) . savepoint ( ( client ) => {
210- const session = new BunSQLSession < SavepointSQL , TFullSchema , TSchema > (
210+ const session = new BunSQLPGSession < SavepointSQL , TFullSchema , TSchema > (
211211 client ,
212212 this . dialect ,
213213 this . schema ,
214214 this . session . options ,
215215 ) ;
216- const tx = new BunSQLTransaction < TFullSchema , TSchema > ( this . dialect , session , this . schema ) ;
216+ const tx = new BunSQLPGTransaction < TFullSchema , TSchema > ( this . dialect , session , this . schema ) ;
217217 return transaction ( tx ) ;
218218 } ) as Promise < T > ;
219219 }
220220}
221221
222- export interface BunSQLQueryResultHKT extends PgQueryResultHKT {
222+ export interface BunSQLPGQueryResultHKT extends PgQueryResultHKT {
223223 type : Assume < this[ 'row' ] , Record < string , any > [ ] > ;
224224}
0 commit comments