conjure-client-sql-stdio.txt

Branches > main > 68ad239 > files / nvim / pack / plugins / opt / conjure / doc / conjure-client-sql-stdio.txt

                                                 *conjure-client-sql-stdio*==============================================================================CONTENTS                                *conjure-client-sql-stdio-contents*    1. Introduction ........ |conjure-client-sql-stdio-introduction|    2. Mappings ................ |conjure-client-sql-stdio-mappings|    3. Configuration ...... |conjure-client-sql-stdio-configuration|    4. Troubleshooting .......... |conjure-client-sql-stdio-trouble|==============================================================================INTRODUCTION                        *conjure-client-sql-stdio-introduction*>  SQL is a programming language for working with relational database  management systems (RDBMS).Conjure starts a SQL REPL within Neovim when you first open a SQL file unlessyou set `conjure#client_on_load` to `v:false`.This client was initially developed using PostgreSQL's `psql` command lineclient. Thus, the default configuration values for `command` and `prompt`pattern` are set for `psql`. The `command` string is set to use a connectionURL to a `postgres` database with a `postgres` user and password of`postgres`. The database is served by a local PostgreSQL server listening onthe default port.Also, if you set up a `~/.pgpass` password file, like so:  -- host:port:db:user:password  localhost:5432:postgres:postgres:postgresYou can use a `command` string like:  "psql -h localhost -U postgres"        (command line)or  "psql postgres://postgres@localhost"   (connection URL) - https://www.postgresql.org/docs/14/libpq-pgpass.htmlPlease note that connecting to databases can be a security risk so consult theappropriate people for your particular situation and environment.  You can use another SQL database with its command line client so check the|conjure-client-sql-stdio-configuration and the documentation for that commandline client.Once configured, you should be able to evaluate files and statements(equivalent to Lisp forms) as you would with other Conjure supportedlanguages.Check out `:ConjureSchool` if you're unsure about what evaluation operationsyou can perform. * https://en.wikipedia.org/wiki/SQL==============================================================================MAPPINGS                                *conjure-client-sql-stdio-mappings*These mappings are the defaults, you can change them as described in|conjure-mappings| and |conjure-configuration|.See |conjure-client-sql-stdio-configuration| for specific configurationoptions relevant to these mappings.<localleader>cs          Start the SQL REPL if it's not running already.<localleader>cS          Stop any existing SQL REPL.<localleader>ei          Interrupt the current SQL REPL.                         *NOTE:* This depends on the program you run for                         a REPL. On macos, when running a `\watch`                         meta-command in `psql`, this works to stop it. But                         during normal interaction, this will kill the REPL so                         you will need to restart it.==============================================================================CONFIGURATION                      *conjure-client-sql-stdio-configuration*All configuration can be set as described in |conjure-configuration|.                                 *g:conjure#client#sql#stdio#mapping#start*`g:conjure#client#sql#stdio#mapping#start`            Start the SQL REPL if it's not running already.            Default: `"cs"`                                  *g:conjure#client#sql#stdio#mapping#stop*`g:conjure#client#sql#stdio#mapping#stop`            Stop any existing SQL REPL.            Default: `"cS"`                           *g:conjure#client#sql#stdio#mapping#eval_reload*`g:conjure#client#sql#stdio#mapping#interrupt`            Interrupt the SQL REPL.            Default: `"ei"`                                       *g:conjure#client#sql#stdio#command*`g:conjure#client#sql#stdio#command`            Command used to start the SQL REPL, modify to meet your needs.            Default: `"psql postgres://postgres:postgres@localhost/postgres"`                                *g:conjure#client#sql#stdio#prompt_pattern*`g:conjure#client#sql#stdio#prompt_pattern`            Lua pattern to identify a new REPL prompt. This match signals to            Conjure that the previous evaluation is complete and we're ready            to submit more code as well as collect all output prior to the            marker as the result.            Default: `"=> "`                           *g:conjure#client#sql#stdio#meta_prefix_pattern*`g:conjure#client#sql#stdio#meta_prefix_pattern`            Lua pattern to identify meta commands that do not require a `;`            suffix. Commands such as `\watch` in postgresql and `.tables` in            duckdb. When Conjure spots one of these it will avoid appending a            semi-colon which is required to execute true statements.            Default: `"^[.\\]%w"`==============================================================================TROUBLESHOOTING                         *conjure-client-sql-stdio-trouble*If you get an error message like "SQLComplete:The dbext plugin must be loadedfor dynamic SQL completion", you can add this Vimscript to your Neovimconfiguration:  " Default to static completion for SQL  let g:omni_sql_default_compl_type = 'syntax'The equivalent Lua would be:  vim.g["omni_sql_default_compl_type"] = 'syntax'This workaround is fromhttps://github.com/neovim/neovim/issues/14433#issuecomment-1183682651.vim:tw=78:sw=2:ts=2:ft=help:norl:et:listchars=