An open API service indexing awesome lists of open source software.

https://github.com/r0man/sqlingvo.node

A ClojureScript driver for SQLingvo on Node.js.
https://github.com/r0man/sqlingvo.node

Last synced: 9 months ago
JSON representation

A ClojureScript driver for SQLingvo on Node.js.

Awesome Lists containing this project

README

          

* SQLingvo.node
#+author: r0man
#+LANGUAGE: en

[[https://clojars.org/sqlingvo.node][https://img.shields.io/clojars/v/sqlingvo.node.svg]]
[[https://travis-ci.org/r0man/sqlingvo.node][https://travis-ci.org/r0man/sqlingvo.node.svg]]
[[http://jarkeeper.com/r0man/sqlingvo.node][http://jarkeeper.com/r0man/sqlingvo.node/status.svg]]
[[http://jarkeeper.com/r0man/sqlingvo.node][https://jarkeeper.com/r0man/sqlingvo.node/downloads.svg]]

/SQLingvo.node/ is a [[https://github.com/r0man/sqlingvo][SQLingvo]] driver for [[https://github.com/clojure/clojurescript][ClojureScript]] on
[[https://nodejs.org][Node.js]]. It uses [[https://github.com/clojure/core.async][core.async]] and the [[https://www.npmjs.com/package/pg][pg]] or [[https://www.npmjs.com/package/pg-native][pg-native]] libraries to
connect to a database and execute /SQL/ statements.

** Usage
*** Sync

#+BEGIN_SRC clojure :exports both :results verbatim
(ns sqlingvo.node.sync-usage
(:require [cljs.pprint :refer [pprint]]
[sqlingvo.core :as sql]
[sqlingvo.node.sync :as db]))

(def db (db/db "postgresql://tiger:scotch@localhost/sqlingvo_node"))

(pprint @(sql/select db [:*]
(sql/from :information_schema.tables)
(sql/where '(= :table_name "pg_statistic"))))
#+END_SRC

#+RESULTS:
: [{:is_insertable_into "YES",
: :self_referencing_column_name nil,
: :user_defined_type_catalog nil,
: :table_type "BASE TABLE",
: :table_schema "pg_catalog",
: :is_typed "NO",
: :user_defined_type_schema nil,
: :user_defined_type_name nil,
: :commit_action nil,
: :table_catalog "sqlingvo_node",
: :reference_generation nil,
: :table_name "pg_statistic"}]

*** Async

#+BEGIN_SRC clojure :exports both :results verbatim
(ns sqlingvo.node.async-usage
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs.core.async :as async]
[cljs.pprint :refer [pprint]]
[sqlingvo.core :as sql]
[sqlingvo.node.async :as db :refer-macros [