Closed Bill-ON-epitech closed 5 months ago
@Bill-ON Ok, I'm going to go through the process you described ~ and use it to confirm your question
@Bill-ON Can you take a look at your schema.prisma file content and pubspec.yaml content? I just walked through the tutorial I wrote before and was able to generate
@medz schema.prisma :
/ This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "dart run orm"
}
datasource db {
provider = "sqlite"
url = "file:./db.sqlite"
}
model Users {
id Int @id @default(autoincrement())
name String
email String @unique
}
pubspec.yaml :
name: hello
description: A sample command-line application.
version: 1.0.0
# repository: https://github.com/my_org/my_repo
environment:
sdk: ^3.0.2
dependencies:
json_annotation: ^4.8.1
orm: ^3.4.3
dev_dependencies:
build_runner: ^2.4.4
json_serializable: ^6.7.0
lints: ^2.1.1
@Bill-ON Maybe it's a network problem~ I can generate it correctly through the dependencies and schema you provided
@medz so my computer has a dual boot ubuntu/windows and i tested the installation process and it works perfectly on windows ???
Without displaying any warning prompts, everytime i entered npx prisma db push
, my database tables were all deleted; to be replaced by the model in schema.prisma.
I will abandon working on ubuntu and instead use Windows. So you can consider this problem solved.
Still thank you very much for responding so quickly
I have same problem on Ubuntu:
dart --version Dart SDK version: 2.19.6 (stable) (Tue Mar 28 13:41:04 2023 +0000) on "linux_x64"
npm --version 9.7.1
dart run orm --help
{"jsonrpc":"2.0","error":{"code":-32700,"message":"Invalid JSON: Unexpected end of input","data":{"request":""}},"id":null}
I have the tables in the database generated, but the client in Dart has not been generated.
OS NAME : Ubuntu 22.04.2
Hello, Following the Getting Started Tutorial is fine up to :
npx prisma db push
After executing this command, the tutorial's video shows the creation of the file "prisma_client.dart" inside the lib folder. But only the file "db.sqlite" was generated in the prisma folder. The output of npxprisma db push
is :Also running
dart run orm --help
should show me what arguments i can use, but it seems the process just waits for my input as if i press enter, i get :