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
Let say I have a simple model/schema, and I am creating a new sqlite DB table:
@dataclassclassUser:
id: intname: stremail: strage: intcon=ibis.sqlite.connect('test.db')
# Create table first time in the initial migrationusers=con.create_table('user', schema=User)
# Later read the table from another fileusers=con.table('user')
I've looked into mutate(), but seems it can only create virtual columns that must rely on expression using an existing column.
Questions:
How would I add a new column in DB, do a kinda migration, to an existing table and data? For example, how would I add a new is_admin: bool = False column with a default value? I.e. ALTER TABLE user ADD COLUMN is_admin BOOLEAN DEFAULT FALSE;
And how would I add a foreign key or constrain, or just an index to optimize specific table in the DB/DWH?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Let say I have a simple model/schema, and I am creating a new sqlite DB table:
I've looked into mutate(), but seems it can only create virtual columns that must rely on expression using an existing column.
Questions:
How would I add a new column in DB, do a kinda migration, to an existing table and data? For example, how would I add a new
is_admin: bool = False
column with a default value? I.e.ALTER TABLE user ADD COLUMN is_admin BOOLEAN DEFAULT FALSE;
And how would I add a foreign key or constrain, or just an index to optimize specific table in the DB/DWH?
Beta Was this translation helpful? Give feedback.
All reactions