UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 982 B
import e from"../../utils/errors/lucid-error.mjs";const t=e=>(typeof e==`object`||typeof e==`function`)&&e!==null&&`then`in e,n=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.adapter==`string`&&typeof t.connect==`function`&&typeof t.inferSchema==`function`&&typeof t.dropAllTables==`function`},r=e=>{if(!e||typeof e!=`object`&&typeof e!=`function`)return!1;let t=e;return typeof e==`function`&&t.__lucidDatabaseAdapterCreator!==!0?!1:typeof t.adapter==`string`&&typeof t.resolve==`function`},i=async(i,a)=>{let o=t(i)?await i:i,s=r(o)?o.resolve(a??{}):o,c=t(s)?await s:s;if(!n(c))throw new e({message:"Lucid could not resolve the configured database adapter. Pass a database adapter instance or adapter-level env factory to `configureLucid({ db })`, such as `db: libsql((env) => ({ ... }))`. Top-level `db: (env) => ...` callbacks are not supported."});return c};export{i as default,i as resolveDatabaseAdapter}; //# sourceMappingURL=resolve-database-adapter.mjs.map