sqlite-utils memory --functions, refs #471

This commit is contained in:
Simon Willison 2022-08-26 22:03:53 -07:00
commit 59e2cfbdc1
3 changed files with 33 additions and 11 deletions

View file

@ -289,3 +289,12 @@ def test_memory_two_files_with_same_stem(tmpdir):
");\n"
"CREATE VIEW t2 AS select * from [data_2];\n"
)
def test_memory_functions():
result = CliRunner().invoke(
cli.cli,
["memory", "select hello()", "--functions", "hello = lambda: 'Hello'"],
)
assert result.exit_code == 0
assert result.output.strip() == '[{"hello()": "Hello"}]'