module.exports=[213012,e=>{"use strict";var t=e.i(692349),r=e.i(616722),n=e.i(336496),a=e.i(106528),s=class{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(){}async releaseMigrationLock(){}get supportsOutput(){return!0}},i=class{#e;#t=new c;#r;#n;constructor(e){this.#e={...e}}async init(){this.#r=this.#e.database,this.#n=new o(this.#r),this.#e.onCreateConnection&&await this.#e.onCreateConnection(this.#n)}async acquireConnection(){return await this.#t.lock(),this.#n}async beginTransaction(e){await e.executeQuery(t.CompiledQuery.raw("begin"))}async commitTransaction(e){await e.executeQuery(t.CompiledQuery.raw("commit"))}async rollbackTransaction(e){await e.executeQuery(t.CompiledQuery.raw("rollback"))}async releaseConnection(){this.#t.unlock()}async destroy(){this.#r?.close()}},o=class{#r;constructor(e){this.#r=e}executeQuery(e){let{sql:t,parameters:r}=e;return Promise.resolve({rows:this.#r.prepare(t).all(...r)})}async *streamQuery(){throw Error("Streaming query is not supported by SQLite driver.")}},c=class{#a;#s;async lock(){for(;void 0!==this.#a;)await this.#a;this.#a=new Promise(e=>{this.#s=e})}unlock(){let e=this.#s;this.#a=void 0,this.#s=void 0,e?.()}},l=class{#r;constructor(e){this.#r=e}async getSchemas(){return[]}async getTables(e={withInternalKyselyTables:!1}){let t=this.#r.selectFrom("sqlite_schema").where("type","=","table").where("name","not like","sqlite_%").select("name").$castTo();return e.withInternalKyselyTables||(t=t.where("name","!=",r.DEFAULT_MIGRATION_TABLE).where("name","!=",r.DEFAULT_MIGRATION_LOCK_TABLE)),Promise.all((await t.execute()).map(({name:e})=>this.#i(e)))}async getMetadata(e){return{tables:await this.getTables(e)}}async #i(e){let t=this.#r,r=(await t.selectFrom("sqlite_master").where("name","=",e).select("sql").$castTo().execute())[0]?.sql?.split(/[\(\),]/)?.find(e=>e.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.[0]?.replace(/["`]/g,"");return{name:e,columns:(await t.selectFrom(a.sql`pragma_table_info(${e})`.as("table_info")).select(["name","type","notnull","dflt_value"]).execute()).map(e=>({name:e.name,dataType:e.type,isNullable:!e.notnull,isAutoIncrementing:e.name===r,hasDefaultValue:null!=e.dflt_value})),isView:!0}}},u=class extends n.DefaultQueryCompiler{getCurrentParameterPlaceholder(){return"?"}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}};e.s(["NodeSqliteDialect",0,class{#e;constructor(e){this.#e={...e}}createDriver(){return new i(this.#e)}createQueryCompiler(){return new u}createAdapter(){return new s}createIntrospector(e){return new l(e)}}])}];

//# sourceMappingURL=0atm_%40better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0padp2e._.js.map