mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
.transform(..., keep_table=name) parameter, closes #571
Also type hints for the transform_sql() method
This commit is contained in:
parent
2c12c01346
commit
61aaa69815
3 changed files with 42 additions and 13 deletions
|
|
@ -1376,6 +1376,12 @@ The ``.transform()`` method takes a number of parameters, all of which are optio
|
|||
|
||||
As a bonus, calling ``.transform()`` will reformat the schema for the table that is stored in SQLite to make it more readable. This works even if you call it without any arguments.
|
||||
|
||||
To keep the original table around instead of dropping it, pass the ``keep_table=`` option and specify the name of the table you would like it to be renamed to:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
table.transform(types={"age": int}, keep_table="original_table")
|
||||
|
||||
Altering column types
|
||||
---------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue