-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to pass a full convert() function definition #355
Comments
Relevant code: sqlite-utils/sqlite_utils/cli.py Lines 2128 to 2135 in 7a43af2
One way to implement this would be to look to see if the code starts with |
Maybe attempt to compile their code, and if it fails try again after adding |
Ideally I'd like to show the perfect syntax error messages to the user - but I don't know if it's possible to do this cleanly because the error might occur with their originally entered code OR it might occur after I add I'm going to punt on that for the moment and tolerate slightly confusing syntax errors. |
Here's an example of the new (slightly confusing) error message: sqlite-utils convert fixtures.db roadside_attractions name '
def foo(value)
bar
baz
'
Error: Syntax error in code:
def foo(value)
invalid syntax Another:
|
Originally posted by @simonw in #353 (comment)
The text was updated successfully, but these errors were encountered: