mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 09:54:31 +02:00
sqlite-utils convert db table column -, refs #353
This commit is contained in:
parent
e328db8eba
commit
a3df483c80
3 changed files with 48 additions and 0 deletions
10
docs/cli.rst
10
docs/cli.rst
|
|
@ -1023,6 +1023,16 @@ You can specify Python modules that should be imported and made available to you
|
|||
'"\n".join(textwrap.wrap(value, 100))' \
|
||||
--import=textwrap
|
||||
|
||||
Use a CODE value of `-` to read from standard input:
|
||||
|
||||
$ cat mycode.py | sqlite-utils convert content.db articles headline -
|
||||
|
||||
Where `mycode.py` contains a fragment of Python code that looks like this:
|
||||
|
||||
```python
|
||||
return value.upper()
|
||||
```
|
||||
|
||||
The transformation will be applied to every row in the specified table. You can limit that to just rows that match a ``WHERE`` clause using ``--where``::
|
||||
|
||||
$ sqlite-utils convert content.db articles headline 'value.upper()' \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue