@payloadcms/db-sqlite 3.65.0-canary.3 → 3.65.0-internal.ef3958a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connect.js +1 -1
- package/dist/connect.js.map +1 -1
- package/package.json +5 -5
package/dist/connect.js
CHANGED
|
@@ -32,7 +32,7 @@ export const connect = async function connect(options = {
|
|
|
32
32
|
if (typeof this.rejectInitializing === 'function') {
|
|
33
33
|
this.rejectInitializing();
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
throw new Error(`Error: cannot connect to SQLite: ${message}`);
|
|
36
36
|
}
|
|
37
37
|
// Only push schema if not in production
|
|
38
38
|
if (process.env.NODE_ENV !== 'production' && process.env.PAYLOAD_MIGRATING !== 'true' && this.push !== false) {
|
package/dist/connect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connect.ts"],"sourcesContent":["import type { DrizzleAdapter } from '@payloadcms/drizzle/types'\nimport type { Connect, Migration } from 'payload'\n\nimport { createClient } from '@libsql/client'\nimport { pushDevSchema } from '@payloadcms/drizzle'\nimport { drizzle } from 'drizzle-orm/libsql'\n\nimport type { SQLiteAdapter } from './types.js'\n\nexport const connect: Connect = async function connect(\n this: SQLiteAdapter,\n options = {\n hotReload: false,\n },\n) {\n const { hotReload } = options\n\n try {\n if (!this.client) {\n this.client = createClient(this.clientConfig)\n }\n\n const logger = this.logger || false\n this.drizzle = drizzle(this.client, { logger, schema: this.schema })\n\n if (!hotReload) {\n if (process.env.PAYLOAD_DROP_DATABASE === 'true') {\n this.payload.logger.info(`---- DROPPING TABLES ----`)\n await this.dropDatabase({ adapter: this })\n this.payload.logger.info('---- DROPPED TABLES ----')\n }\n }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n this.payload.logger.error({ err, msg: `Error: cannot connect to SQLite: ${message}` })\n if (typeof this.rejectInitializing === 'function') {\n this.rejectInitializing()\n }\n
|
|
1
|
+
{"version":3,"sources":["../src/connect.ts"],"sourcesContent":["import type { DrizzleAdapter } from '@payloadcms/drizzle/types'\nimport type { Connect, Migration } from 'payload'\n\nimport { createClient } from '@libsql/client'\nimport { pushDevSchema } from '@payloadcms/drizzle'\nimport { drizzle } from 'drizzle-orm/libsql'\n\nimport type { SQLiteAdapter } from './types.js'\n\nexport const connect: Connect = async function connect(\n this: SQLiteAdapter,\n options = {\n hotReload: false,\n },\n) {\n const { hotReload } = options\n\n try {\n if (!this.client) {\n this.client = createClient(this.clientConfig)\n }\n\n const logger = this.logger || false\n this.drizzle = drizzle(this.client, { logger, schema: this.schema })\n\n if (!hotReload) {\n if (process.env.PAYLOAD_DROP_DATABASE === 'true') {\n this.payload.logger.info(`---- DROPPING TABLES ----`)\n await this.dropDatabase({ adapter: this })\n this.payload.logger.info('---- DROPPED TABLES ----')\n }\n }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n this.payload.logger.error({ err, msg: `Error: cannot connect to SQLite: ${message}` })\n if (typeof this.rejectInitializing === 'function') {\n this.rejectInitializing()\n }\n throw new Error(`Error: cannot connect to SQLite: ${message}`)\n }\n\n // Only push schema if not in production\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_MIGRATING !== 'true' &&\n this.push !== false\n ) {\n await pushDevSchema(this as unknown as DrizzleAdapter)\n }\n\n if (typeof this.resolveInitializing === 'function') {\n this.resolveInitializing()\n }\n\n if (process.env.NODE_ENV === 'production' && this.prodMigrations) {\n await this.migrate({ migrations: this.prodMigrations as Migration[] })\n }\n}\n"],"names":["createClient","pushDevSchema","drizzle","connect","options","hotReload","client","clientConfig","logger","schema","process","env","PAYLOAD_DROP_DATABASE","payload","info","dropDatabase","adapter","err","message","Error","String","error","msg","rejectInitializing","NODE_ENV","PAYLOAD_MIGRATING","push","resolveInitializing","prodMigrations","migrate","migrations"],"mappings":"AAGA,SAASA,YAAY,QAAQ,iBAAgB;AAC7C,SAASC,aAAa,QAAQ,sBAAqB;A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AAC0B,mBAAmB,KAAK,YAAY;QAClD,IAAI,CAACA,mBAAmB;IAC1B;IAEA,IAAIjB,QAAQC,GAAG,CAACa,QAAQ,KAAK,gBAAgB,IAAI,CAACI,cAAc,EAAE;QAChE,MAAM,IAAI,CAACC,OAAO,CAAC;YAAEC,YAAY,IAAI,CAACF,cAAc;QAAgB;IACtE;AACF,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/db-sqlite",
|
|
3
|
-
"version": "3.65.0-
|
|
3
|
+
"version": "3.65.0-internal.ef3958a",
|
|
4
4
|
"description": "The officially supported SQLite database adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -70,17 +70,17 @@
|
|
|
70
70
|
"prompts": "2.4.2",
|
|
71
71
|
"to-snake-case": "1.0.0",
|
|
72
72
|
"uuid": "9.0.0",
|
|
73
|
-
"@payloadcms/drizzle": "3.65.0-
|
|
73
|
+
"@payloadcms/drizzle": "3.65.0-internal.ef3958a"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/pg": "8.10.2",
|
|
77
77
|
"@types/to-snake-case": "1.0.0",
|
|
78
78
|
"@types/uuid": "10.0.0",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
79
|
+
"@payloadcms/eslint-config": "3.28.0",
|
|
80
|
+
"payload": "3.65.0-internal.ef3958a"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"payload": "3.65.0-
|
|
83
|
+
"payload": "3.65.0-internal.ef3958a"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"build": "pnpm build:swc && pnpm build:types",
|