Comments (3)
Simplest possible recreation of the bug:
python -c '
import sqlite_utils
db = sqlite_utils.Database(memory=True)
db.execute("""
CREATE TABLE "logs" (
[id] INTEGER PRIMARY KEY,
[chat_id] INTEGER REFERENCES [log]([id]),
[reply_to_id] INTEGER
);
""")
db["logs"].add_foreign_key("reply_to_id", "logs", "id")
'
That chat_id
line is the line that causes the problem - because it is defining a reference to a table that no longer exists!
from sqlite-utils.
Although this is revealing a problem in the underlying code (that schema is invalid), it also represents a regression: sqlite-utils 3.34
ran this just fine, but it fails on sqlite-utils 3.35
due to the change made in:
from sqlite-utils.
I'm inclined to say this isn't a bug in sqlite-utils
though - it's a bug in the code that calls it. So I'm not going to fix it here.
from sqlite-utils.
Related Issues (20)
- Mechanism for de-registering registered SQL functions HOT 3
- Ability to tell if a Database is an in-memory one HOT 1
- `table.transform()` should preserve `rowid` values HOT 6
- Represent compound foreign keys in table.foreign_keys output HOT 2
- Cascading DELETE not working with Table.delete(pk) HOT 1
- Feature request: sqlite-utils insert-files should be able to convert fields
- Cannot find spatialite on arm64 linux HOT 1
- Move plugin directory into documentation
- `sqlite-utils transform` removes the `AUTOINCREMENT` keyword
- Pyhton 3.12 Bug report HOT 2
- Insert fails with `Error: Python int too large to convert to SQLite INTEGER`; can we use `NUMERIC` here? HOT 1
- str and int as aliases for text and integer HOT 2
- pyright and mypy showing access error messages for basic sqlite-utils usage
- Attached database tables representable by `Table`
- `table.upsert/upsert_all` fails to write row when `not_null` is absent and the schema definition includes `not_null` HOT 3
- `.transform()` effect on triggers and indices
- Automatic JSON de-serialization
- Windows: Correct way to initialize spatialite?
- sqlite-utils command fails when used with xargs HOT 2
- Drop support for Python 3.7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlite-utils.