Possibility to ignore incompatible native types
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 47.6k
- Forks
- 2.5k
- Avg merge
- 21h 59m
- Merged PRs (30d)
- 95
Description
Problem
I am testing my server on SQLite while the actual production server is using Postgres. I am doing that by switching out the datasource block completely by merging different base files with prisma-merge. Recently I have started using native types. For example I am using @db.Uuid which is available in Postgres, however it is not available in SQLite.
The problem is that when setting up my tests it is throwing this error:
error: Native type Uuid is not supported for sqlite connector.
Suggested solution
I think what would be best for this is if you could set an option when running prisma generate or in the datasource block to ignore native types completely? There could also already be such possibility but I couldn't find any.
Alternatives
Of course I could test my server against a Postgres database which could save me a lot of trouble but this solution of testing with SQLite I came up with worked so well in the past...
Do you have any other ideas on how to run tests involving database queries?
Additional context
This is the full error of one field:
error: Native type Uuid is not supported for sqlite connector.
--> schema.prisma:15
|
14 | model User {
15 | id String @db.Uuid @id
|
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the schema.prisma example and the prisma generate and datasource configuration described in the issue, then trace where SQLite rejects @db.Uuid. Done would mean the requested behavior and configuration surface are defined and covered for the SQLite-versus-Postgres testing scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, sqlite
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100