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

MySQL bool columns end up as SQLite BLOB columns upon conversion #49

Open
amoeba opened this issue Feb 25, 2023 · 0 comments
Open

MySQL bool columns end up as SQLite BLOB columns upon conversion #49

amoeba opened this issue Feb 25, 2023 · 0 comments

Comments

@amoeba
Copy link

amoeba commented Feb 25, 2023

I'm trying to use db-to-sqlite to convert a set of MySQL DDL files into an SQLite database. Some of my tables use the BIT(1) type to encode boolean values but the resulting SQLite database ends up with BLOB columns where I think INTEGER would be more natural for SQLite.

This is new territory for me but things I've picked up while researching my issue are:

  • MySQL doesn't have a full-fledged boolean type, similar to SQLite
  • People either use TINYINT or BIT(1) to store bools in a space-efficient way
    • TINYINT(1) may have even been an alias for BIT(1) at some point (source) but is no longer

I think it would be nice if db-to-sqlite could turn BIT(1) fields into INTEGER rather than BLOB because the current behavior is harder to query than it needs to be.

I'm happy to submit a PR for this with tests covering this and any related behavior.

amoeba added a commit to amoeba/db-to-sqlite that referenced this issue Feb 28, 2023
amoeba added a commit to amoeba/db-to-sqlite that referenced this issue Feb 28, 2023
amoeba added a commit to amoeba/db-to-sqlite that referenced this issue Feb 28, 2023
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

No branches or pull requests

1 participant