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