Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate-diff: error on non-existing sqlite database #2836

Merged
merged 2 commits into from
Apr 11, 2022
Merged

Conversation

tomhoule
Copy link
Contributor

The default behaviour of the sqlite driver is to implicitly create the
database when we connect to it.

Given that

  • db push has a database creation step
  • implicit database creation is otherwise unexpected
  • there is a stub of this for some commands in the TS code already
  • we have more than enough time to QA changes we make today

This commit changes the sql migration connector so that whenever we
connect to a sqlite database, we return a P1003 (DatabaseDoesNotExist)
error if there is no file at the expected path.

closes prisma/prisma#12226

@tomhoule tomhoule added this to the 3.13.0 milestone Apr 11, 2022
The default behaviour of the sqlite driver is to implicitly create the
database when we connect to it.

Given that

- db push has a database creation step
- implicit database creation is otherwise unexpected
- there is a stub of this for some commands in the TS code already
- we have more than enough time to QA changes we make today

This commit changes the sql migration connector so that whenever we
connect to a sqlite database, we return a P1003 (DatabaseDoesNotExist)
error if there is no file at the expected path.

closes prisma/prisma#12226
@tomhoule tomhoule marked this pull request as ready for review April 11, 2022 07:29
@tomhoule tomhoule requested a review from a team as a code owner April 11, 2022 07:29
@tomhoule tomhoule merged commit 0317ad0 into main Apr 11, 2022
@tomhoule tomhoule deleted the me/sqlite-init branch April 11, 2022 12:29
tomhoule added a commit to prisma/prisma that referenced this pull request Apr 11, 2022
See prisma/prisma-engines#2836 for the details
on the engines side of things. The consequence of that PR is that we are
now doing that check in engines, and doing it in more cases than the
check removed in this PR.
Jolg42 added a commit to prisma/prisma that referenced this pull request Apr 12, 2022
tomhoule added a commit to prisma/prisma that referenced this pull request Apr 22, 2022
See prisma/prisma-engines#2836 for the details
on the engines side of things. The consequence of that PR is that we are
now doing that check in engines, and doing it in more cases than the
check removed in this PR.
Jolg42 pushed a commit to prisma/prisma that referenced this pull request Apr 25, 2022
* chore(migrate): remove sqlite check now performed engine-side

See prisma/prisma-engines#2836 for the details
on the engines side of things. The consequence of that PR is that we are
now doing that check in engines, and doing it in more cases than the
check removed in this PR.

* .

* chore(migrate): remove sqlite check now performed engine-side

See prisma/prisma-engines#2836 for the details
on the engines side of things. The consequence of that PR is that we are
now doing that check in engines, and doing it in more cases than the
check removed in this PR.

* .

* cli: updated snapshot in doctor

* sdk: updated snapshots

* migrate: updated snapshots

Co-authored-by: Alberto Schiabel <skiabo97@gmail.com>
Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Diff] Always error if path to Sqlite db is wrong or db does not exist
2 participants