CockroachDB for moondb — the moonpostgres wire protocol, with the server's own capability report and version detection.
moon add moonbitstack/moonckdbasync fn run() -> Unit raise {
let db = @moonckdb.connect("127.0.0.1", 26257, "root", "", "defaultdb")
let server = @moonckdb.server_of(db) // Server::Cockroach, asked not assumed
let plan = @moonckdb.capabilities_for(server) // notifications: false
db.execute("CREATE TABLE hero (id INT PRIMARY KEY, name TEXT)", []) |> ignore
db.close()
}| CockroachDB v24.3 | |
|---|---|
| Extended query protocol, prepared statements | yes |
| Binary result format | yes |
| DECLARE / FETCH cursors | yes |
| COPY in both directions | yes |
| Savepoints | yes |
| RETURNING | yes |
| LISTEN / NOTIFY | no |
| DROP TYPE … CASCADE | no |
| Multi-statement COPY … FROM in one query string | no (COPY together with other statements…) |
Install
Download zipCockroachDB for moondb — the moonpostgres wire protocol, with the server's own capability report and version detection.