Make square braces only return tables, not views#700
Open
Conversation
Breaking change for 4.0: db["name"] now only returns Table objects, never View objects.
This improves type safety since views lack methods like .insert().
Use db.view("view_name") to access views explicitly.
Closes #699
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #700 +/- ##
==========================================
- Coverage 95.15% 95.14% -0.01%
==========================================
Files 8 8
Lines 3114 3113 -1
==========================================
- Hits 2963 2962 -1
Misses 151 151 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Updated python-api.rst to clarify that dictionary-style syntax
db["name"] only returns Table objects. Use db.view("name") for views.
Documents all breaking changes in 4.0 for both the Python library and CLI: - db["name"] only returns tables, not views - Default float type changed to REAL - convert() no longer skips False values - Table schemas use double quotes - Upsert uses modern SQLite syntax - Type detection now default for CSV/TSV import - sqlite-utils tui moved to plugin - Python 3.10+ required
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change for 4.0: db["name"] now only returns Table objects, never View objects.
This improves type safety since views lack methods like .insert().
Use db.view("view_name") to access views explicitly.
Closes:
📚 Documentation preview 📚: https://sqlite-utils--700.org.readthedocs.build/en/700/