lmclient

lmclient is a scriptable protocol client and lmcode host in one native executable for JDBC databases, Redis, mail, message queues, MQTT, and MongoDB.

Quick reference

lmscript install github:lmctl-ai/lmclient@latest
lmclient --version
lmclient --lmcode-schema --json
lmclient --lmcode-signatures
lmclient --url jdbc:sqlite::memory: --sql "SELECT 1 AS ok" --format json
ItemKindPurpose
--url URL --sql SQLJDBC CLIRun a SQL query against SQLite, DuckDB, H2, PostgreSQL, or SQL Server.
--metadata KIND [--table T]JDBC CLIInspect tables, columns, keys, foreign_keys, indexes, views, or schemas.
redis / mail / queue / mqtt / mongoSubcommandsExecute Redis, SMTP/IMAP, AMQP, MQTT, and MongoDB operations with JSON output.
connect(url) / connect_file(url, file)Host functionsOpen a JDBC Connection inside an _lmcode_ program.
Connection.query / exec / diff / tablesHost methodsRun SQL, inspect JDBC metadata, or diff two database schemas.
Result.csv / json / number / textHost methodsExport query results or inspect typed cells by zero-based row and column.
dbhost = _lmcode_ cli="lmclient" install="github:lmctl-ai/lmclient@latest";
let c = connect("jdbc:sqlite::memory:");
c.exec("CREATE TABLE items(name TEXT, qty INT); INSERT INTO items VALUES ('bolt', 50);");
let r = c.query("SELECT name, qty FROM items");
r.csv("items.csv");
c.close();
end _lmcode_
res = run_lmcode(dbhost);
assert(res.ok);

Documentation pages

Source repository and releases