Skip to content

Commit

Permalink
feat: expose Statement::sql
Browse files Browse the repository at this point in the history
  • Loading branch information
andykais committed Jul 8, 2024
1 parent 632a1b8 commit b3eab6e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,4 @@ export type { Database as Driver }
export { field }
export { Vars }
export { MigrationError, MigrationValidationError } from '../src/migration.ts'
export type { SchemaGeneric as Fields }
1 change: 0 additions & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ abstract class ModelBase implements ModelInstance {

protected build_param_sql(schema_field: ParamsField<any>): string {
if (schema_field.alias_of) {
console.debug(schema_field.alias_of)
return `:${schema_field.field_name}`
} else {
return `:${schema_field.field_name}`
Expand Down
2 changes: 2 additions & 0 deletions src/statement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ interface ExecInfo {
}

export interface Statement<Params extends SchemaGeneric, Result extends SchemaGeneric> {
sql: string

one: (...[params]: OptionalOnEmpty<Params>) => Result | undefined
all: (...[params]: OptionalOnEmpty<Params>) => Result[]
exec: (...[params]: OptionalOnEmpty<Params>) => ExecInfo
Expand Down

0 comments on commit b3eab6e

Please sign in to comment.