kayak / pypika

PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.
http://pypika.readthedocs.io/en/latest/
Apache License 2.0
2.43k stars 293 forks source link

simple insert_dict() builder #725

Open edvardm opened 1 year ago

edvardm commented 1 year ago

Additions

Idea pretty much the same as in issue #533 :

Query().into(self.table_abc).insert_dict({"num": 1, "timestamp": datetime(2023, 4, 18)})

# INSERT INTO "abc" ("num","timestamp") VALUES (1,'2023-04-18T00:00:00')

Given how it's implemented, maybe from_dict() would be more suitable, as into() is already part of context? Multi-value inserts are trickier though, as they seem to vary between engines


Edit:

edvardm commented 3 months ago

Sorry for the delay, some quite tragic happened at work and forgot about this for some time. Hopefully resolved noted issues