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.
- Host: GitHub
- URL: https://github.com/r0man/sqlingvo.node
- Owner: r0man
- License: epl-1.0
- Created: 2016-06-10T11:05:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-12-19T22:19:09.000Z (about 6 years ago)
- Last Synced: 2025-03-23T20:43:34.277Z (10 months ago)
- Language: Clojure
- Size: 25.4 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.org
- Funding: .github/FUNDING.yml
- License: LICENSE
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 [