Giter Club home page Giter Club logo

Comments (10)

Pengap avatar Pengap commented on May 16, 2024

Execute make switch-db-mode command, how is it selected?

from teable.

kasbah avatar kasbah commented on May 16, 2024

So here's how it goes when I follow the instructions exactly:

  • cd teable && corepack enable && pnpm install
    seems to work fine

  • pnpm g:build


> @teable/teable@ g:build /home/kaspar/projects/teable
> pnpm -r run build

Scope: 10 of 11 workspace projects
packages/icons build$ tsc
└─ Done in 1.7s
packages/db-main-prisma build$ tsc
│ src/prisma-manager.ts(5,15): error TS2305: Module '"@prisma/client"' has no exported membe…
│ src/prisma.service.ts(3,10): error TS2305: Module '"@prisma/client"' has no exported membe…
│ src/prisma.service.ts(4,15): error TS2305: Module '"@prisma/client"' has no exported membe…
│ src/prisma.service.ts(102,51): error TS7006: Parameter 'prisma' implicitly has an 'any' ty…
│ src/prisma.service.ts(131,16): error TS2339: Property '$connect' does not exist on type 'P…
│ src/prisma.service.ts(135,10): error TS2339: Property '$on' does not exist on type 'Prisma…
│ src/prisma.service.ts(135,30): error TS7006: Parameter 'e' implicitly has an 'any' type.
│ src/seeds/e2e/space-seeds.ts(2,15): error TS2305: Module '"../../"' has no exported member…
│ src/seeds/e2e/space-seeds.ts(55,43): error TS7006: Parameter 'tx' implicitly has an 'any' …
│ src/seeds/e2e/user-seeds.ts(3,15): error TS2305: Module '"../../"' has no exported member …
│ src/seeds/seed.abstract.ts(1,15): error TS2305: Module '"@prisma/client"' has no exported …
└─ Failed in 1.6s at /home/kaspar/projects/teable/packages/db-main-prisma
packages/core build$ tsc
└─ Running...
packages/ui-lib build$ cross-env NODE_ENV=production tsc --build tsconfig.build.json
└─ Running...
/home/kaspar/projects/teable/packages/db-main-prisma:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @teable/[email protected] build: `tsc`
Exit status 2
 ELIFECYCLE  Command failed with exit code 1.
 
  • make switch-db-mode


Select a database to start.

1)sqlite			Lightweight embedded, ideal for mobile and embedded systems, simple, resource-efficient, easy integration (default database)
2)postges(pg)			Powerful and scalable, suitable for complex enterprise needs, highly customizable, rich community support

Enter a command: 1
make[1]: Entering directory '/home/kaspar/projects/teable'
sed: can't read s~^PRISMA_DATABASE_URL=.*~PRISMA_DATABASE_URL=file:../../db/main.db~: No such file or directory
sed: can't read s~^PRISMA_DATABASE_URL=.*~PRISMA_DATABASE_URL=file:../../db/main.db~: No such file or directory
make[1]: *** [Makefile:283: switch.prisma.env] Error 2
make[1]: Leaving directory '/home/kaspar/projects/teable'
make[1]: Entering directory '/home/kaspar/projects/teable'

> @teable/[email protected] prisma-generate /home/kaspar/projects/teable/packages/db-main-prisma
> prisma generate "--schema" "./prisma/sqlite/schema.prisma"

Prisma schema loaded from prisma/sqlite/schema.prisma

✔ Generated Prisma Client (v5.11.0) to ./../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client in 167ms

Start using Prisma Client in Node.js (See: https://pris.ly/d/client)

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)

import { PrismaClient } from '@prisma/client/edge'
const prisma = new PrismaClient()


See other ways of importing Prisma Client: http://pris.ly/d/importing-client

┌─────────────────────────────────────────────────────────────┐
│  Deploying your app to serverless or edge functions?        │
│  Try Prisma Accelerate for connection pooling and caching.  │
│  https://pris.ly/cli/accelerate                             │
└─────────────────────────────────────────────────────────────┘


> @teable/[email protected] prisma-migrate /home/kaspar/projects/teable/packages/db-main-prisma
> dotenv-flow -p ../../apps/nextjs-app -- pnpm prisma migrate "deploy" "--schema" "./prisma/sqlite/schema.prisma"
Prisma schema loaded from prisma/sqlite/schema.prisma
Datasource "db": SQLite database

Error: Prisma schema validation - (get-config wasm)
Error code: P1012
error: Error validating datasource `db`: the URL must start with the protocol `file:`.
  -->  schema.prisma:9
   | 
 8 |   provider = "sqlite"
 9 |   url      = env("PRISMA_DATABASE_URL")
   | 

Validation Error Count: 1
[Context: getConfig]

Prisma CLI Version : 5.11.0
 ELIFECYCLE  Command failed with exit code 1.
make[1]: *** [Makefile:269: sqlite.mode] Error 1
make[1]: Leaving directory '/home/kaspar/projects/teable'
make: *** [Makefile:294: switch-db-mode] Error 2

from teable.

Pengap avatar Pengap commented on May 16, 2024

Are all these actions performed in the teable project root directory?

from teable.

kasbah avatar kasbah commented on May 16, 2024

That's right (except the cd teable of course). Should say: this is a fresh clone of develop branch too.

from teable.

Pengap avatar Pengap commented on May 16, 2024

Can I see the value configured for the PRISMA_DATABASE_URL option in your .env.development file?

from teable.

kasbah avatar kasbah commented on May 16, 2024
$ grep PRISMA apps/nextjs-app/.env.development 
PRISMA_DATABASE_URL=postgresql://teable:[email protected]:5432/teable?schema=public&statement_cache_size=1

from teable.

Pengap avatar Pengap commented on May 16, 2024

$ grep PRISMA apps/nextjs-app/.env.development 

PRISMA_DATABASE_URL=postgresql://teable:[email protected]:5432/teable?schema=public&statement_cache_size=1

It seems that after running make switch-db-mode and selecting SQLite, the contents of the configuration file weren't automatically replaced.

Let's try manually modifying PRISMA_DATABASE_URL=file:../../db/main.db, and then run make switch-db-mode again and choose option 1.

Lastly, may I ask which operating system you are using?

from teable.

kasbah avatar kasbah commented on May 16, 2024

I'm pretty sure that has made it work. After running that pnpm g:build completes too.

It seems that after running make switch-db-mode and selecting SQLite, the contents of the configuration file weren't automatically replaced.

Yep, you can see it in the log posted above:

make[1]: Entering directory '/home/kaspar/projects/teable'
sed: can't read s~^PRISMA_DATABASE_URL=.*~PRISMA_DATABASE_URL=file:../../db/main.db~: No such file or directory
sed: can't read s~^PRISMA_DATABASE_URL=.*~PRISMA_DATABASE_URL=file:../../db/main.db~: No such file or directory
make[1]: *** [Makefile:283: switch.prisma.env] Error 2
make[1]: Leaving directory '/home/kaspar/projects/teable'
make[1]: Entering directory '/home/kaspar/projects/teable'

I'm on Manjaro Linux. Maybe we are running into some sed incompatibility?

$ sed --version
sed (GNU sed) 4.9

from teable.

Pengap avatar Pengap commented on May 16, 2024

Let's try the latest code from the branch (develop);
I've used perl to replace sed. I hope this is helpful and look forward to your reply. Thank you.

from teable.

kasbah avatar kasbah commented on May 16, 2024

Seems good! Thanks!

from teable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.