-
-
Notifications
You must be signed in to change notification settings - Fork 35
✨ add support for creating SQLite STRICT tables via -M/--strict
CLI switch
#107
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
Conversation
WalkthroughAdds a new Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant CLI as CLI (mysql-to-sqlite3)
participant Conv as MySQLtoSQLite
participant Trans as Transporter
participant SQLite as sqlite3
User->>CLI: Run with --strict
CLI->>Conv: Construct(sqlite_strict=True, ...)
Conv->>Trans: Init(sqlite_strict=True)
Trans->>SQLite: Check sqlite_version
alt SQLite >= 3.37.0
Trans-->>Trans: _sqlite_strict = True
Note right of Trans: STRICT enabled
else SQLite < 3.37.0
Trans-->>Trans: _sqlite_strict = False
Trans-->>CLI: Log warning (STRICT disabled)
end
CLI->>Trans: Create tables
alt _sqlite_strict True
Trans->>SQLite: CREATE TABLE ... ) STRICT;
else
Trans->>SQLite: CREATE TABLE ... );
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
-M / --strict
CLI switch
-M / --strict
CLI switch-M/--strict
CLI switch
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #107 +/- ##
==========================================
+ Coverage 94.14% 94.23% +0.08%
==========================================
Files 8 8
Lines 649 659 +10
==========================================
+ Hits 611 621 +10
Misses 38 38 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
-M/--strict
CLI switch-M/--strict
CLI switch
-M/--strict
CLI switch-M/--strict
CLI switch
This pull request adds support for creating SQLite tables in STRICT mode when the SQLite version supports it. A new CLI option is introduced to enable this feature, and appropriate checks and warnings are implemented for unsupported SQLite versions. The documentation is updated, and unit tests are added to ensure correct behavior.
New STRICT mode support:
--strict
(-M
) CLI option to enable creation of SQLite STRICT tables when supported. This is reflected in both the CLI argument parsing (cli.py
) and the documentation (README.md
,docs/README.rst
). [1] [2] [3] [4]MySQLtoSQLite
class now accepts asqlite_strict
parameter, stores it as an attribute, and checks the SQLite version. If STRICT mode is requested but not supported (SQLite < 3.37.0), a warning is logged and STRICT mode is disabled. [1] [2] [3]CREATE TABLE
statements in the generated SQL.Testing and validation:
CREATE TABLE
statements when enabled.Closes #106