ordered list in a database
Previous development reveals that relation-based databases cannot properly handle arrays that need insert()
method.
A hack is to use a string-based index that allows gaps between indexes so that insertion can be realized without reordering the rest of the entries. 1
This is feasible on the SQL level but the availability under ORM tools still needs investigation.
ORM: SQLAlchamy vs Django
On the ORM side, I also tried Django
as an alternative to SQLAlchamy
.
Some major difference includes:
Django
builds the database according to the model, whileSQLAlchamy
requires manual mapping. This may be a desired feature for fast development but comes at a cost of less extensibility as an ORMDjango
model object links to each other by a query manager whileSQLAlchamy
object links to each other directly. TheDjango
way will cause a problem in type hint that would require further hacks likedjango_hint
and manual type decalration everytime a query is made. I consider this as a feature missing bug ofDjango
Django
comes with a lot of other features since it's developed as more of a website backend than a simple ORM