pwtools.sql.SQLiteDB.attach_column¶
- SQLiteDB.attach_column(col, values, sqltype=None, table=None, **kwds)[source]¶
Attach (add) a new column named col of sqltype and fill it with values. With overwrite=True, allow writing into existing columns, i.e. behave like
fill_column()
.This is a short-cut method which essentially does
add_column(...); fill_column(...)
- Parameters:
col (str) – Column name.
values (sequence) – Values to be inserted.
sqltype (str, optional) – sqlite type of values in values, obtained from values[0] if None
table (str, optional)
**kwds – additional keywords passed to
fill_column()
, default: start=1, extend=True, overwrite=False