Repository navigation
Add type compiler. - #32
Conversation
|
Neat! I know we have a dictionary from BigQuery types to SQLAlchemy types. Would it make sense to invert that dictionary and use it for these methods? I hate to have the same mapping defined in two places, but I guess this is the only place so far where we need to go from SQLAlchemy types to BigQuery types. |
|
Definitely don't want to duplicate logic, but it looks like the mapping in |
|
Yeah, you're right. That's an unfortunate fact of the fact that BigQuery still uses the legacy SQL data type names in the table API methods but we use the standard SQL data types for SQL in the DB-API connector. |
Map generic datatypes to bigquery datatypes.
dc92fb0 to
6f19d70
Compare
|
Amended to add a few more common types. |
|
Thanks @jmcarp! I've added a simple test, but it looks like sqlalchemy doesn't allow creating tables without primary keys?
|
|
I was testing with sqlalchemy core, which apparently does support tables without primary keys. For sqlalchemy declarative, tables without primary keys aren't supported, but I added a ddl compiler that skips foreign and primary keys on table creation. |
|
Thanks! |
Map generic datatypes to bigquery datatypes.
With this patch, I was able to create tables with common types via pybigquery.