From b76b60d964790128c29ccb2bfbe2cf4ac3af0813 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sat, 9 Oct 2021 22:56:22 -0700 Subject: [PATCH] update list of visualization tools --- README.md | 2 +- doc/datafy-nav-and-schema.md | 6 ++++-- test/next/jdbc/test_fixtures.clj | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b6cf2d0..6c76bd2 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ From a `DataSource`, either you or `next.jdbc` can create a `java.sql.Connection The primary SQL execution API in `next.jdbc` is: * `plan` -- yields an `IReduceInit` that, when reduced, executes the SQL statement and then reduces over the `ResultSet` with as little overhead as possible. -* `execute!` -- executes the SQL statement and produces a vector of realized hash maps, that use qualified keywords for the column names, of the form `:/`. If you join across multiple tables, the qualified keywords will reflect the originating tables for each of the columns. If the SQL produces named values that do not come from an associated table, a simple, unqualified keyword will be used. The realized hash maps returned by `execute!` are `Datafiable` and thus `Navigable` (see Clojure 1.10's `datafy` and `nav` functions, and tools like Cognitect's REBL). Alternatively, you can specify `{:builder-fn rs/as-arrays}` and produce a vector with column names followed by vectors of row values. `rs/as-maps` is the default for `:builder-fn` but there are also `rs/as-unqualified-maps` and `rs/as-unqualified-arrays` if you want unqualified `:` column names (and there are also lower-case variants of all of these). +* `execute!` -- executes the SQL statement and produces a vector of realized hash maps, that use qualified keywords for the column names, of the form `:
/`. If you join across multiple tables, the qualified keywords will reflect the originating tables for each of the columns. If the SQL produces named values that do not come from an associated table, a simple, unqualified keyword will be used. The realized hash maps returned by `execute!` are `Datafiable` and thus `Navigable` (see Clojure 1.10's `datafy` and `nav` functions, and tools like [Portal](https://github.com/djblue/portal), [Reveal](https://github.com/vlaaad/reveal), and Cognitect's REBL). Alternatively, you can specify `{:builder-fn rs/as-arrays}` and produce a vector with column names followed by vectors of row values. `rs/as-maps` is the default for `:builder-fn` but there are also `rs/as-unqualified-maps` and `rs/as-unqualified-arrays` if you want unqualified `:` column names (and there are also lower-case variants of all of these). * `execute-one!` -- executes the SQL or DDL statement and produces a single realized hash map. The realized hash map returned by `execute-one!` is `Datafiable` and thus `Navigable`. In addition, there are API functions to create `PreparedStatement`s (`prepare`) from `Connection`s, which can be passed to `plan`, `execute!`, or `execute-one!`, and to run code inside a transaction (the `transact` function and the `with-transaction` macro). diff --git a/doc/datafy-nav-and-schema.md b/doc/datafy-nav-and-schema.md index 57ee95f..bd1ea8f 100644 --- a/doc/datafy-nav-and-schema.md +++ b/doc/datafy-nav-and-schema.md @@ -6,13 +6,15 @@ Shortly after REBL's release, I added experimental support to `clojure.java.jdbc In addition to `datafy` and `nav` support in the result sets, as of version 1.0.462, there is a `next.jdbc.datafy` namespace that can be required to extend these protocols to a number of JDBC object types. See **JDBC Datafication** near the end of this page for more detail of this. +Additional tools that understand `datafy` and `nav` include [Portal](https://github.com/djblue/portal) and [Reveal](https://github.com/vlaaad/reveal). + ## The `datafy`/`nav` Lifecycle on Result Sets Here's how the process works, for result sets produced by `next.jdbc`: * `execute!` and `execute-one!` produce result sets containing rows that are `Datafiable`, -* Tools like REBL can call `datafy` on result sets to render them as "pure data" (which they already are, but this makes them also `Navigable`), -* Tools like REBL allow users to "drill down" into elements of rows in the "pure data" result set, using `nav`, +* Tools like Portal, Reveal, and REBL can call `datafy` on result sets to render them as "pure data" (which they already are, but this makes them also `Navigable`), +* Tools like Portal, Reveal, and REBL allow users to "drill down" into elements of rows in the "pure data" result set, using `nav`, * If a column in a row represents a foreign key into another table, calling `nav` will fetch the related row(s), * Those can in turn be `datafy`'d and `nav`'d to continue drilling down through connected data in the database. diff --git a/test/next/jdbc/test_fixtures.clj b/test/next/jdbc/test_fixtures.clj index f5515cd..b73e1f4 100644 --- a/test/next/jdbc/test_fixtures.clj +++ b/test/next/jdbc/test_fixtures.clj @@ -230,7 +230,7 @@ CREATE PROCEDURE FRUITP" (cond (hsqldb?) "() READS SQL DATA DYNAMIC RESULT SETS ;; this is a convenience to bring next.jdbc's test dependencies ;; into any REPL that has the add-lib3 branch of tools.deps.alpha ;; which allows me to develop and test next.jdbc inside my work's - ;; "everything" REBL environment + ;; "everything" REPL environment (require '[clojure.tools.deps.alpha.repl :refer [add-libs]] '[clojure.java.io :as io] '[clojure.edn :as edn])