import{DatabasePathGenerator as a}from"../../database-path-generator";import{SQLITE_DATABASE_NAME as o,SQLITE_LOCAL_DATABASE_FOLDER as A}from"../../constants";const E="./dist/server/esbuild/cache/server",_="./src/server/providers/database/databases/sqlite-db/schemas/*",n="./src/server/providers/database/databases/sqlite-db/migrations",r="DRIZZLE_DB_TARGET",T=()=>process.env[r]==="remote"?"remote":"local",c=()=>`file:${a.generateDatabasePath({baseDir:E,databaseName:o,additionalFolder:A})}`,D=()=>{const s=T(),e=process.env.SQLD_REMOTE_DATABASE_URL,t=process.env.SQLD_REMOTE_DATABASE_AUTH_TOKEN;if(s==="remote"){if(!e||!t)throw new Error(`Remote DB selected (${r}=remote), but SQLD_REMOTE_DATABASE_URL or SQLD_REMOTE_DATABASE_AUTH_TOKEN is missing.`);return{url:e,authToken:t}}return{url:c()}};var S={schema:_,out:n,dialect:"turso",dbCredentials:D()};export{S as default};
