3 ms·
This is excellent, I've always wanted a simple db library that makes defining a schema upfront optional. After all a schema is a constraint that can be set in
by akrymski 13y ago
This is excellent, I've always wanted a simple db library that makes defining a schema upfront optional. After all a schema is a constraint that can be set in stone later on, just like adding indices for optimisation purposes.
Few questions:
- what's the performance like? is there any overhead to alchemy, eg comparing schema every time you do an insert?
- no way to specify primary keys as an alternative to the auto-generated id column?
- no table.remove()?
- what about inserting more complicated data structures, eg a dict with a nested dict or a list? would be great if those were serialized auto-magically into a blob type (or used to create another table with a foreign key?)
- would be nice to be able to freeze a schema with table.freeze() for example: from then on new columns don't get created automatically, or get stored in an extra blob column (this is a very common scenario for python devs where non-indexable columns just get stuck in a blob)
- let me optionally define a schema and specify defaults with table.schema(name='', price=0.0')
- would love to see table.ensureIndex('column', 'unique') similar to mongo for quickly creating indices
- db = Dataset() should do dataset.create('sqlite:///:memory:') for me - would be nice to have that as the default connector, so that Dataset() acts as LINQ for Python by default
- dataset.freeze is nice but I'd rather have dataset.export() & dataset.import() letting me easily copy rows from one db to another (after inspection for example)
Thanks for creating this!