File tree Expand file tree Collapse file tree 8 files changed +24
-32
lines changed Expand file tree Collapse file tree 8 files changed +24
-32
lines changed Original file line number Diff line number Diff line change
1
+ # Prerequisites
2
+
3
+ - Have ` npm ` installed and in PATH
4
+ - Have ` git ` installed and in PATH
5
+
6
+ # Setting up the repository for contribution
7
+
8
+ - Clone this repository: ` git clone https://github.com/tursodatabase/libsql-client-ts `
9
+ - Change the current working directory to the cloned repository: ` cd libsql-client-ts `
10
+ - Install dependencies: ` npm i `
11
+ - Change the current working directory to ` libsql-core ` 's workspace: ` cd packages/libsql-core `
12
+ - Built the core package: ` npm run build `
13
+ - Go back to the root directory to start making changes: ` cd ../.. `
Original file line number Diff line number Diff line change @@ -123,9 +123,6 @@ export class Sqlite3Client implements Client {
123
123
this . protocol = "file" ;
124
124
}
125
125
126
- async execute ( stmt : InStatement ) : Promise < ResultSet > ;
127
- async execute ( sql : string , args ?: InArgs ) : Promise < ResultSet > ;
128
-
129
126
async execute (
130
127
stmtOrSql : InStatement | string ,
131
128
args ?: InArgs ,
@@ -171,9 +168,7 @@ export class Sqlite3Client implements Client {
171
168
}
172
169
}
173
170
174
- async migrate (
175
- stmts : Array < InStatement > ,
176
- ) : Promise < Array < ResultSet > > {
171
+ async migrate ( stmts : Array < InStatement > ) : Promise < Array < ResultSet > > {
177
172
this . #checkNotClosed( ) ;
178
173
const db = this . #getDb( ) ;
179
174
try {
Original file line number Diff line number Diff line change @@ -814,7 +814,7 @@ describe("batch()", () => {
814
814
) ;
815
815
816
816
const n = 100 ;
817
- const promises = [ ] ;
817
+ const promises = [ ] as Array < any > ;
818
818
for ( let i = 0 ; i < n ; ++ i ) {
819
819
const ii = i ;
820
820
promises . push (
@@ -885,7 +885,7 @@ describe("batch()", () => {
885
885
test (
886
886
"batch with a lot of different statements" ,
887
887
withClient ( async ( c ) => {
888
- const stmts = [ ] ;
888
+ const stmts = [ ] as Array < any > ;
889
889
for ( let i = 0 ; i < 1000 ; ++ i ) {
890
890
stmts . push ( `SELECT ${ i } ` ) ;
891
891
}
@@ -902,7 +902,7 @@ describe("batch()", () => {
902
902
const n = 20 ;
903
903
const m = 200 ;
904
904
905
- const stmts = [ ] ;
905
+ const stmts = [ ] as Array < any > ;
906
906
for ( let i = 0 ; i < n ; ++ i ) {
907
907
for ( let j = 0 ; j < m ; ++ j ) {
908
908
stmts . push ( { sql : `SELECT ?, ${ j } ` , args : [ i ] } ) ;
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ export async function executeHranaBatch(
255
255
disableForeignKeys : boolean = false ,
256
256
) : Promise < Array < ResultSet > > {
257
257
if ( disableForeignKeys ) {
258
- batch . step ( ) . run ( "PRAGMA foreign_keys=off" )
258
+ batch . step ( ) . run ( "PRAGMA foreign_keys=off" ) ;
259
259
}
260
260
const beginStep = batch . step ( ) ;
261
261
const beginPromise = beginStep . run ( transactionModeToBegin ( mode ) ) ;
@@ -287,7 +287,7 @@ export async function executeHranaBatch(
287
287
. condition ( hrana . BatchCond . not ( hrana . BatchCond . ok ( commitStep ) ) ) ;
288
288
rollbackStep . run ( "ROLLBACK" ) . catch ( ( _ ) => undefined ) ;
289
289
if ( disableForeignKeys ) {
290
- batch . step ( ) . run ( "PRAGMA foreign_keys=on" )
290
+ batch . step ( ) . run ( "PRAGMA foreign_keys=on" ) ;
291
291
}
292
292
293
293
await batch . execute ( ) ;
Original file line number Diff line number Diff line change @@ -96,9 +96,6 @@ export class HttpClient implements Client {
96
96
return this . #promiseLimitFunction( fn ) ;
97
97
}
98
98
99
- async execute ( stmt : InStatement ) : Promise < ResultSet > ;
100
- async execute ( sql : string , args ?: InArgs ) : Promise < ResultSet > ;
101
-
102
99
async execute (
103
100
stmtOrSql : InStatement | string ,
104
101
args ?: InArgs ,
@@ -180,9 +177,7 @@ export class HttpClient implements Client {
180
177
} ) ;
181
178
}
182
179
183
- async migrate (
184
- stmts : Array < InStatement > ,
185
- ) : Promise < Array < ResultSet > > {
180
+ async migrate ( stmts : Array < InStatement > ) : Promise < Array < ResultSet > > {
186
181
return this . limit < Array < ResultSet > > ( async ( ) => {
187
182
try {
188
183
const hranaStmts = stmts . map ( stmtToHrana ) ;
Original file line number Diff line number Diff line change @@ -119,9 +119,6 @@ export class Sqlite3Client implements Client {
119
119
this . protocol = "file" ;
120
120
}
121
121
122
- async execute ( stmt : InStatement ) : Promise < ResultSet > ;
123
- async execute ( sql : string , args ?: InArgs ) : Promise < ResultSet > ;
124
-
125
122
async execute (
126
123
stmtOrSql : InStatement | string ,
127
124
args ?: InArgs ,
@@ -167,9 +164,7 @@ export class Sqlite3Client implements Client {
167
164
}
168
165
}
169
166
170
- async migrate (
171
- stmts : Array < InStatement > ,
172
- ) : Promise < Array < ResultSet > > {
167
+ async migrate ( stmts : Array < InStatement > ) : Promise < Array < ResultSet > > {
173
168
this . #checkNotClosed( ) ;
174
169
const db = this . #getDb( ) ;
175
170
try {
Original file line number Diff line number Diff line change @@ -154,9 +154,6 @@ export class WsClient implements Client {
154
154
return this . #promiseLimitFunction( fn ) ;
155
155
}
156
156
157
- async execute ( stmt : InStatement ) : Promise < ResultSet > ;
158
- async execute ( sql : string , args ?: InArgs ) : Promise < ResultSet > ;
159
-
160
157
async execute (
161
158
stmtOrSql : InStatement | string ,
162
159
args ?: InArgs ,
@@ -226,9 +223,7 @@ export class WsClient implements Client {
226
223
} ) ;
227
224
}
228
225
229
- async migrate (
230
- stmts : Array < InStatement > ,
231
- ) : Promise < Array < ResultSet > > {
226
+ async migrate ( stmts : Array < InStatement > ) : Promise < Array < ResultSet > > {
232
227
return this . limit < Array < ResultSet > > ( async ( ) => {
233
228
const streamState = await this . #openStream( ) ;
234
229
try {
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export interface Client {
87
87
* ```
88
88
*/
89
89
execute ( stmt : InStatement ) : Promise < ResultSet > ;
90
+ execute ( sql : string , args ?: InArgs ) : Promise < ResultSet > ;
90
91
91
92
/** Execute a batch of SQL statements in a transaction.
92
93
*
@@ -155,9 +156,7 @@ export interface Client {
155
156
* ]);
156
157
* ```
157
158
*/
158
- migrate (
159
- stmts : Array < InStatement > ,
160
- ) : Promise < Array < ResultSet > > ;
159
+ migrate ( stmts : Array < InStatement > ) : Promise < Array < ResultSet > > ;
161
160
162
161
/** Start an interactive transaction.
163
162
*
You can’t perform that action at this time.
0 commit comments