deco-cx / apps

App definitions by deco.cx
Apache License 2.0
82 stars 85 forks source link

deco records script pullProd.ts is failing trying to create a db with file:// #869

Closed igorbrasileiro closed 2 months ago

igorbrasileiro commented 2 months ago

Issue Type

Description

run records/scripts/pullProd.ts causes error:

deno task db:pull:prod
Task db:pull:prod deno eval --env 'import "apps/records/scripts/pullProd.ts"'
LibsqlError: URL_SCHEME_NOT_SUPPORTED: The client that uses Web standard APIs supports only "libsql:", "wss:", "ws:", "https:" and "http:" URLs, got "file:". For more information, please read https://github.com/libsql/libsql-client-ts#supported-urls
    at _createClient (.../Library/Caches/deno/npm/registry.npmjs.org/@libsql/client/0.7.0/lib-esm/web.js:19:15)
    at createClient (.../Library/Caches/deno/npm/registry.npmjs.org/@libsql/client/0.7.0/lib-esm/web.js:8:12)
    at run (https://denopkg.com/deco-cx/apps@0.59.8/records/scripts/pullProd.ts:80:21)
    at eventLoopTick (ext:core/01_core.js:175:7) {
  code: "URL_SCHEME_NOT_SUPPORTED",
  rawCode: undefined,
  name: "LibsqlError"
}

Steps to Reproduce (for bugs)

  1. Have a deco site
  2. Install deco records via admin
  3. run in the terminal deno eval --env 'import "apps/records/scripts/pullProd.ts"'

Expected Behavior

Dump db and create sqlite.db file locally

Actual Behavior

Crashes creating the sqlite client