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

sqlite temporary tables do not honor withoutRowid #8430

Closed
pthrasher opened this issue Dec 5, 2021 · 0 comments · Fixed by #8431
Closed

sqlite temporary tables do not honor withoutRowid #8430

pthrasher opened this issue Dec 5, 2021 · 0 comments · Fixed by #8431

Comments

@pthrasher
Copy link
Contributor

Issue Description

sqlite migrations must re-create tables when doing most changes. These temporary tables don't honor withoutRowid

Expected Behavior

I expect the new temporary_ to honor any special options that exist for sqlite in the EntityMetadata

Actual Behavior

Original tables are created properly with WITHOUT ROWID but the new temporary tables don't receive this info because there's no table in EntityMetadata that matches this temporary prefixed name.

Steps to Reproduce

  1. Create Entity with withoutRowid: true as an option.
  2. Attempt to generate migration.
  3. Notice that none of the temporary table create statements have a trailing "WITHOUT ROWID" even though the original create table statements do.

Relevant Database Driver(s)

DB Type Reproducible
aurora-data-api no
aurora-data-api-pg no
better-sqlite3 no
cockroachdb no
cordova no
expo no
mongodb no
mysql no
nativescript no
oracle no
postgres no
react-native no
sap no
sqlite yes
sqlite-abstract yes
sqljs no
sqlserver no

Are you willing to resolve this issue by submitting a Pull Request?

  • ✅ Yes, I have the time, and I know how to start.
  • ✖️ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

PR is complete. Just running tests, will submit shortly. :-)

pthrasher pushed a commit to pthrasher/typeorm that referenced this issue Dec 5, 2021
nordinh pushed a commit to nordinh/typeorm that referenced this issue Aug 29, 2022
* fix: sqlite temporary tables now honor withoutRowid

Closes: typeorm#8430

* merge master

* fixed `withoutRowid` on table recreation;
added test;

Co-authored-by: Thrasher <thrasher@grayshift.com>
Co-authored-by: Alex Messer <dmzt08@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant