File tree 5 files changed +8
-9
lines changed
5 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 15
15
"db:stop" : " docker compose down --remove-orphans --volumes"
16
16
},
17
17
"imports" : {
18
- "@halvardm/sqlx" : " ../deno-sqlx/mod.ts" ,
19
- "@halvardm/sqlx/testing" : " ../deno-sqlx/lib/testing.ts" ,
18
+ "@halvardm/sqlx" :
" jsr:@halvardm/[email protected] " ,
20
19
"@std/assert" : " jsr:@std/assert@^0.221.0" ,
21
20
"@std/async" : " jsr:@std/async@^0.221.0" ,
22
21
"@std/crypto" : " jsr:@std/crypto@^0.221.0" ,
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export class MysqlQueriable extends SqlxBase implements
53
53
readonly queryOptions : MysqlQueryOptions ;
54
54
55
55
get connected ( ) : boolean {
56
- throw new Error ( "Method not implemented." ) ;
56
+ return this . connection . connected ;
57
57
}
58
58
59
59
constructor (
@@ -181,9 +181,9 @@ export class MysqlPrepared extends SqlxBase implements
181
181
) {
182
182
super ( ) ;
183
183
this . connection = connection ;
184
- this . #queriable = new MysqlQueriable ( connection ) ;
185
184
this . sql = sql ;
186
185
this . queryOptions = options ;
186
+ this . #queriable = new MysqlQueriable ( connection , this . queryOptions ) ;
187
187
}
188
188
189
189
execute (
Original file line number Diff line number Diff line change 1
- import { SqlxError } from "@halvardm/sqlx" ;
1
+ import { isSqlxError , SqlxError } from "@halvardm/sqlx" ;
2
2
3
3
export class MysqlError extends SqlxError {
4
4
constructor ( msg : string ) {
@@ -46,5 +46,5 @@ export class MysqlTransactionError extends MysqlError {
46
46
* Check if an error is a MysqlError
47
47
*/
48
48
export function isMysqlError ( err : unknown ) : err is MysqlError {
49
- return err instanceof MysqlError ;
49
+ return isSqlxError ( err ) && err instanceof MysqlError ;
50
50
}
Original file line number Diff line number Diff line change 1
- import { getLogger } from "@std/log" ;
1
+ import { getLogger , type Logger } from "@std/log" ;
2
2
import { MODULE_NAME } from "./meta.ts" ;
3
3
4
4
/**
@@ -7,6 +7,6 @@ import { MODULE_NAME } from "./meta.ts";
7
7
*
8
8
* @see {@link https://deno.land/std/log/mod.ts }
9
9
*/
10
- export function logger ( ) {
10
+ export function logger ( ) : Logger {
11
11
return getLogger ( MODULE_NAME ) ;
12
12
}
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export function replaceParams(
58
58
} )`;
59
59
}
60
60
case "string" :
61
- return `"${ escapeString ( val ) } "` ;
61
+ return `"${ escapeString ( val as string ) } "` ;
62
62
case "undefined" :
63
63
return "NULL" ;
64
64
case "number" :
You can’t perform that action at this time.
0 commit comments