File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,12 @@ import type {ColumnSchema} from "../runtime/index.js";
66import { getColumnType } from "./sqlite.js" ;
77
88export default function sqlite (
9- { path = ":memory:" } : SQLiteConfig ,
9+ { path} : SQLiteConfig ,
1010 context : DatabaseContext
1111) : QueryTemplateFunction {
12- if ( path !== undefined ) path = join ( context . cwd , path ) ;
1312 return async ( strings , ...params ) => {
1413 const date = new Date ( ) ;
15- const database = new Database ( path ) ;
14+ const database = new Database ( path === undefined ? ":memory:" : join ( context . cwd , path ) ) ;
1615 try {
1716 const statement = database . prepare ( strings . join ( "?" ) ) ;
1817 const rows = statement . all ( ...params ) as Record < string , unknown > [ ] ;
Original file line number Diff line number Diff line change @@ -6,13 +6,12 @@ import type {ColumnSchema} from "../runtime/index.js";
66import { getColumnType } from "./sqlite.js" ;
77
88export default function sqlite (
9- { path = ":memory:" } : SQLiteConfig ,
9+ { path} : SQLiteConfig ,
1010 context : DatabaseContext
1111) : QueryTemplateFunction {
12- if ( path !== undefined ) path = join ( context . cwd , path ) ;
1312 return async ( strings , ...params ) => {
1413 const date = new Date ( ) ;
15- const database = new DatabaseSync ( path ) ;
14+ const database = new DatabaseSync ( path === undefined ? ":memory:" : join ( context . cwd , path ) ) ;
1615 try {
1716 const statement = database . prepare ( strings . join ( "?" ) ) ;
1817 const rows = statement . all ( ...params ) as Record < string , unknown > [ ] ;
You can’t perform that action at this time.
0 commit comments