Comments (36)
https://pypi.org/project/axiom/0.8.0rc1/ c/o https://github.com/twisted/axiom/blob/0.8.0rc1/.github/workflows/publish.yml
from axiom.
There is an evil incantation which will make a quick upgrade possible.
http://nbviewer.ipython.org/gist/glyph/2f3fd023b273e53c84fc
from axiom.
does the evil mad scientist cackle
from axiom.
It might be a good idea to ask drh about this specifically. I'm reasonably sure it'll work consistently, but he's the only authority on the subject.
Also, did you test the case where VACUUM does in fact work correctly now, just in case there's something special about ROWID we're forgetting about?
from axiom.
Here's a version of the notebook that does a VACUUM
, names the oid
column differently, bumps the schema version, and re-opens the store. http://nbviewer.ipython.org/urls/glyph.im/blob/2C4F608E-26FC-4688-8432-C19C33171FBF.ipynb
from axiom.
I think you need to delete a row that was not the last row added to the table in order to really demonstrate that VACUUM is behaving correctly.
from axiom.
@mithrandi - feel free to make a hacked up version of the notebook :). Maybe it's time to start actually having a branch / PR for this somewhere though?
from axiom.
@mithrandi - also, some very basic experiments I did showed OIDs changing if there were more than 10 rows or so in the database - was I doing those wrong?
from axiom.
So I played around a bit, with the following results:
A version of your example which demonstrates ROWID stability after deleting some rows before VACUUMing.
A further modified version which demonstrates how ROWIDs are not stable without making the schema change.
So, I'm fairly satisfied with these empirical results, but I would still love to hear from drh whether this can be expected to work reliably.
from axiom.
Is drh on github? @\drh isn't him, but it would be neat to just tag him in :)
from axiom.
Posted about this on the sqlite-users
list; sadly, drh seems to think it doesn't work.
EDIT: Fixed the sqlite-users archive link, which apparently changed(?)
from axiom.
Just a comment from the peanut gallery, but what's wrong with adding a migration that does what drh suggested?
BEGIN;
ALTER TABLE some_table_name RENAME TO temp_name;
CREATE TABLE some_table_name(oid INTEGER PRIMARY KEY, ....);
INSERT INTO some_table_name SELECT oid, * FROM temp_name;
DROP TABLE temp_name;
COMMIT;
from axiom.
@ldanielburr Yes, we'll have to do that. In fact it could be expressed as even less work; we don't do ALTER TABLE
anywhere, and all our migrations already copy code from old tables to new tables, deleting as they go.
The problem is in detecting that the change needs to happen. Right now we have only a single axis of migration: up through different versions of classes; this version is encoded in the table name. To implement this, we need a meta-schema version; one that indicates what sqlite3 features are available, which means we need a different way of encoding that information; either by adding features to the table-naming convention or by putting it somewhere else in the database. Not impossible, just something we were hoping to avoid with the simple ALTER TABLE
hack.
from axiom.
So I'm looking at fixing this issue again. When opening a store, we can check whether the system tables (axiom_objects etc.) have an explicit PK or not. We also know which columns are in each item type's schema, so we can check for the presence of a storeID
column there. Coupled with ignoring storeID
in the schema mismatch check this would allow us to handle existing stores.
New types / versions / tables could always be created with the storeID
column, and axiomatic upgrade
could upgrade the system tables as well as even upgrading existing types without bumping the schema version. There could also be a flag to auto-upgrade system tables on store open.
from axiom.
Okay, I have a PR up; reviews greatly appreciated.
from axiom.
Thank you, so much, everybody who worked on this. It's weirdly kind of emotional seeing a bug that was really bothering me so much over a decade ago actually, finally get fixed.
from axiom.
It was pretty satisfying working on the fix too! Although I think we still need to roll a new release?
from axiom.
@ldanielburr are you interested in being the release manager? Happy to add you on PyPI.
from axiom.
@glyph, please point me at the release management docs, and I'll take a look. I don't want to promise anything yet, but I will commit to reviewing the release management process docs and giving you a firm answer :)
from axiom.
@ldanielburr It's really just
$ python setup.py sdist bdist_wheel
$ twine upload dist/*
what's your username on PyPI? I'll give you upload access and you can do this.
from axiom.
Ideally we would update NEWS.txt with info about the ROWID change since it's a big one and eg. may make axiomatic upgrade
unexpectedly take a long time. You'll also need to bump axiom/_version.py
from axiom.
@glyph, my PyPI username is "somenamenobodyelsehas".
from axiom.
@mithrandi, agreed, there should be a NEWS.txt, version bump, etc.
from axiom.
@ldanielburr You now have upload access to Axiom.
from axiom.
@glyph thanks for the PyPI access. I will commit to getting the newsfile and version updates up for a PR sometime next week, and then the upload to PyPI.
from axiom.
Ok, so I didn't get to this task yet. Just updating this thread to let people know I still intend to make a release.
from axiom.
@ldanielburr we all know how it goes with open source :-). Thanks for the update.
from axiom.
@ldanielburr soooooo… how’s it going?
from axiom.
@glyph, it is going like pride before a fall ;) Sorry I haven't gotten to this yet. Holiday break is coming up in a few weeks, and I'll try to give this a go in December.
from axiom.
from axiom.
How do we promote this to “not an RC”?
from axiom.
Basically just create a release on GitHub with a not-an-RC version number (ie. 0.8.0); the release artifacts will then be built and published to PyPI automatically. My plan is to do the final release in a few days just to allow a little testing if anyone wants.
from axiom.
All right, happy to let that play out.
from axiom.
Problems: #112
from axiom.
https://pypi.org/project/axiom/0.8.0/
from axiom.
Amazing. At long, long last :)
from axiom.
Related Issues (20)
- Python 3 support HOT 5
- Release artifacts are broken
- `axiom.attributes.bytes` shadows builtin name
- In memory powerup is only able to register a single item.
- pyenv us a newer PyPy on Travis
- Switch to Codecov for coverage
- Helper for declaring legacy items HOT 1
- Intermittent failure in reactor selection tests
- Question: raw queries? HOT 1
- NEWS.txt isn't shipped in sdist
- Store API for setting the journal mode
- Decorator for installables HOT 4
- Default log rotation is bad
- Update PyPy
- Setting typeName to unicode produces bizarre errors
- axiomatic analyze
- axiomatic vacuum
- Store flags for journal_mode and autovacuum_mode
- Creating and deleting an item in the same transaction leaves a ghost item
- Store._loadedItem returns stale Item from Store.objectCache
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 axiom.