Make picodata admin prompt more intuitive
Currently our picodata connect
and picodata admin
consoles have a picodata>
prompt prefix. And there's no visual identification of which mode the console is in lua or sql. As a result the user may find them self in this situation:
picodata> grant write on table "characters" to "alex";
---
- error: '[string "grant write on table "characters" to "alex"..."]:1: ''='' expected
near ''write'''
...
The user is attempting to input an sql command, but the console is in lua mode and fails to parse the command. The error doesn't say that it tried to parse a lua command and failed.
Solution
We could solve this by changing our prompt to lua>
or sql>
depending on the current mode, that way the user has a bit more info to help them figure out their error.
So we would have
sql> \lua
Language switched to Lua
lua> \sql
Language switched to Sql
sql>
Or we could add a prefix to the error message failed to parse a lua expression: ...
, but this seems to be more difficult considering how our console is implemented.