You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With recent improvements, most notably crate/crate#11165, which added the gen_random_text_uuid() scalar function, primary key values can be automatically generated when inserting new records. This was essential to make INSERT operations work like table.insert(dict(name="John Doe", age=37)).
The corresponding SQL DDL statement looks like:
CREATETABLEIF NOT EXISTS "doc"."testdrive" (
"id"TEXT DEFAULT gen_random_text_uuid() NOT NULL,
"name"TEXT,
"age"INTEGER,
"gender"TEXT,
PRIMARY KEY ("id")
);
Currently, the schema has to be provided manually, maybe because dataset itself only handles automatic provisioning of autoincrement-like columns, i.e. one of Types.integer, Types.bigint12. It would be a nice-to-have to make the automatic schema creation work, like it works on other databases as well. Maybe it will be enough to add Types.{string,text} at 2?
One of the main features of dataset is to automatically create tables and columns as data is inserted. This behaviour can optionally be disabled via the ensure_schema argument. It can also be overridden in a lot of the data manipulation methods using the ensure flag.
Hi there,
back in a while, I've tried to use the sweet
dataset
package with CrateDB.For exercising it, and to provide a common ground for others to experiment with, I've created the
cratedb-dataset-demo.py
gist.Within this meta issue, all related issues will be tracked which are needed to make the demo program work completely.
With kind regards,
Andreas.
References
gen_random_text_uuid
scalar crate#11165information_schema.key_column_usage
? crate#13102CrateDialect.get_pk_constraint
for CrateDB>=5.1 crate-python#459LIMIT ALL OFFSET 0
crate#13104server_default
column definition option sqlalchemy-cratedb#106lastrowid
and SQLAlchemy'sinserted_primary_key
attributes sqlalchemy-cratedb#94The text was updated successfully, but these errors were encountered: