Skip to content

Commit 32adb67

Browse files
committed
chore: Renamed iql -> gensql in sci code
1 parent 3c88590 commit 32adb67

File tree

12 files changed

+107
-107
lines changed

12 files changed

+107
-107
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The command-line application currently supports GenSQL-strict and GenSQL-permiss
4343
If you would like to use `GenSQL.query` to query SPPL models you will need to ensure that SPPL is on the classpath, and that [libpython-clj](https://github.com/clj-python/libpython-clj) can find a Python where SPPL is installed. The easiest way to accomplish this is to use [Nix](https://nixos.org/):
4444

4545
```shell
46-
nix develop github:OpenGen/GenSQL.gpm.sppl -c clj -Sdeps '{:deps {io.github.OpenGen/GenSQL.gpm.sppl {:git/sha "52f8316e094b3644709dccde8f0a935f9b55f187"}}}' -M -m gensql.query.main --help
46+
nix develop github:OpenGen/GenSQL.gpm.sppl -c clj -Sdeps '{:deps {io.github.OpenGen/GenSQL.gpm.sppl {:git/sha "718de40878766bb8d08acc2b429a76ed662a1352"}}}' -M -m gensql.query.main --help
4747
```
4848

4949
### Clojure interface

Diff for: deps-lock.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
{
55
"lib": "io.github.OpenGen/GenSQL.inference",
66
"url": "https://github.com/OpenGen/GenSQL.inference.git",
7-
"rev": "c3cef474ba964a37fc2e5ff667055f5b77e12c45",
7+
"rev": "689fe740dead93f3ba349a88efa52f2544aa138b",
88
"git-dir": "https/github.com/OpenGen/GenSQL.inference",
9-
"hash": "sha256-gjVmfbcAEeb0uHJTOUrFasDhZY+c4wI8M5W+itJynz4="
9+
"hash": "sha256-dQZHbTzf7Ee0rKNrn61tlBSPT7MXVVsPHO05DFN6Zvw="
1010
},
1111
{
1212
"lib": "io.github.clojure/tools.build",

Diff for: deps.edn

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
metosin/muuntaja {:mvn/version "0.6.8"}
66
net.cgrand/macrovich {:mvn/version "0.2.1"}
77
net.cgrand/xforms {:mvn/version "0.19.2"}
8-
io.github.OpenGen/GenSQL.inference {:git/sha "c3cef474ba964a37fc2e5ff667055f5b77e12c45"}
8+
io.github.OpenGen/GenSQL.inference {:git/sha "689fe740dead93f3ba349a88efa52f2544aa138b"}
99
org.babashka/sci {:mvn/version "0.3.32"}
1010
org.clojure/clojure {:mvn/version "1.11.1"}
1111
com.google.javascript/closure-compiler-unshaded {:mvn/version "v20230802"}

Diff for: flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
depsCache = pkgsWithCljNixOverlay.callPackage ./nix/depsCache {};
2525
uber = pkgs.callPackage ./nix/uber {inherit depsCache;};
2626

27-
pname = "iql";
27+
pname = "gensql";
2828
bin = pkgs.callPackage ./nix/bin { inherit uber pname; };
2929

3030
basicToolsFn = pkgs: with pkgs; [

Diff for: src/gensql/query/base.cljc

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@
5858
str-rel (map stringify-keys rel)
5959
str-attrs (map str (relation/attributes rel))]
6060
(with-meta str-rel
61-
{:iql/columns str-attrs}))))
61+
{:gensql/columns str-attrs}))))

Diff for: src/gensql/query/db.cljc

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
(defn get-table
2727
[db k]
28-
(get-in db [:iql/tables k]))
28+
(get-in db [:gensql/tables k]))
2929

3030
(defn safe-get-table
3131
[db k]
@@ -36,7 +36,7 @@
3636

3737
(defn get-model
3838
[db k]
39-
(get-in db [:iql/models k]))
39+
(get-in db [:gensql/models k]))
4040

4141
(defn safe-get-model
4242
[db k]
@@ -49,17 +49,17 @@
4949
"Adds a table with key `k` to the database. Turns k into a string."
5050
[db k table]
5151
(let [table-name (name k)] ; TODO: keep using `name`?
52-
(assoc-in db [:iql/tables table-name] table)))
52+
(assoc-in db [:gensql/tables table-name] table)))
5353

5454
(defn with-model
5555
"Adds a model with key `k` to the database. Turns k into a string."
5656
[db k model]
5757
(let [model-name (name k)] ; TODO: keep using `name`?
58-
(assoc-in db [:iql/models model-name] model)))
58+
(assoc-in db [:gensql/models model-name] model)))
5959

6060
(defn env
6161
"A map used for SCI lookup of models/relations."
6262
;; FIXME: Check for, or handle, name collisions between models and tables.
6363
[db]
64-
(merge (:iql/tables db)
65-
(:iql/models db)))
64+
(merge (:gensql/tables db)
65+
(:gensql/models db)))

Diff for: src/gensql/query/main.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
(if (instance? Exception result)
7474
(print-exception result)
7575
(let [columns (get (meta result)
76-
:iql/columns
76+
:gensql/columns
7777
(into #{} (mapcat keys) result))
7878
header-row (map name columns)
7979
cells (map (apply juxt columns) result)

Diff for: src/gensql/query/scalar.cljc

+13-13
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
[node]
3434
(match/match node
3535
[:conditioned-by-expr model _conditioned _by [:star _]]
36-
`(~'iql/condition-all ~(plan model))
36+
`(~'gensql/condition-all ~(plan model))
3737
[:conditioned-by-expr model _conditioned _by [:star _] [:conditioned-by-except-clause & except-children]]
38-
`(~'iql/condition-all-except ~(plan model) ~(plan (into [:conditioned-by-except-clause] except-children)))
38+
`(~'gensql/condition-all-except ~(plan model) ~(plan (into [:conditioned-by-except-clause] except-children)))
3939
[:conditioned-by-expr model _conditioned _by child]
40-
`(~'iql/condition ~(plan model) ~(plan child))
40+
`(~'gensql/condition ~(plan model) ~(plan child))
4141
[:conditioned-by-except-clause _except model-var-list]
4242
(plan model-var-list)))
4343

@@ -86,24 +86,24 @@
8686

8787
[:density-event-group "(" child ")"] (plan child)
8888

89-
[:probability-expr _prob _of event _under model] `(~'iql/prob ~(plan model) ~(plan event))
90-
[:density-expr _prob _density _of event _under model] `(~'iql/pdf ~(plan model) ~(plan event))
89+
[:probability-expr _prob _of event _under model] `(~'gensql/prob ~(plan model) ~(plan event))
90+
[:density-expr _prob _density _of event _under model] `(~'gensql/pdf ~(plan model) ~(plan event))
9191

92-
[:mutual-info-expr _m _i _of lhs _with rhs _under model] `(~'iql/mutual-info ~(plan model) ~(vec (plan lhs)) ~(vec (plan rhs)))
93-
[:approx-mutual-info-expr _a _m _i _of lhs _with rhs _under model] `(~'iql/approx-mutual-info ~(plan model) ~(vec (plan lhs)) ~(vec (plan rhs)))
92+
[:mutual-info-expr _m _i _of lhs _with rhs _under model] `(~'gensql/mutual-info ~(plan model) ~(vec (plan lhs)) ~(vec (plan rhs)))
93+
[:approx-mutual-info-expr _a _m _i _of lhs _with rhs _under model] `(~'gensql/approx-mutual-info ~(plan model) ~(vec (plan lhs)) ~(vec (plan rhs)))
9494

9595
[:model-expr child] (plan child)
9696
[:model-expr "(" child ")"] (plan child)
9797

9898
#?@(:clj [[:generative-table-expr _generative _table relation]
9999
(let [query-plan (requiring-resolve 'gensql.query.plan/plan)]
100-
`(~'iql/eval-relation-plan (~'quote ~(query-plan relation))))])
100+
`(~'gensql/eval-relation-plan (~'quote ~(query-plan relation))))])
101101

102102
;; Matches either :conditioned-by-expr or :conditioned-by-except-clause
103103
;; and defers to conditioned-by-plan* to avoid https://clojure.atlassian.net/browse/CLJ-1852
104104
[(:or :conditioned-by-expr :conditioned-by-except-clause) & _] (conditioned-by-plan* ws-free-node)
105105

106-
[:constrained-by-expr model _constrained _by event] `(~'iql/constrain ~(plan model) ~(plan event))
106+
[:constrained-by-expr model _constrained _by event] `(~'gensql/constrain ~(plan model) ~(plan event))
107107

108108

109109
[:value child] (literal/read child)
@@ -112,8 +112,8 @@
112112
[:variable-list & variables] (into [] (comp (filter tree/branch?) (map plan)) variables) ; remove commas
113113

114114
[:identifier child] (plan child)
115-
[:delimited-symbol s] (list 'iql/safe-get 'iql-bindings s)
116-
[:simple-symbol s] (list 'iql/safe-get 'iql-bindings s))))
115+
[:delimited-symbol s] (list 'gensql/safe-get 'gensql-bindings s)
116+
[:simple-symbol s] (list 'gensql/safe-get 'gensql-bindings s))))
117117

118118
(defn inference-event
119119
[event]
@@ -300,7 +300,7 @@
300300
'* (nil-safe (auto-unbox *))
301301
'/ (nil-safe (auto-unbox /))
302302
'log (nil-safe (auto-unbox math/log))}
303-
'iql {'safe-get safe-get
303+
'gensql {'safe-get safe-get
304304
'prob prob
305305
'pdf pdf
306306
#?@(:clj ['eval-relation-plan
@@ -348,7 +348,7 @@
348348
opts {:namespaces #?(:clj (namespaces env' sci-bindings)
349349
:cljs (namespaces))
350350
:bindings (merge sci-bindings
351-
{'iql-bindings sci-bindings})}]
351+
{'gensql-bindings sci-bindings})}]
352352
;; ensure pr-str doesn't truncate by setting print-length to nil
353353
(binding [*print-length* nil]
354354
(try (let [sci-result (sci/eval-string (pr-str sexpr) opts)]

Diff for: src/gensql/query/statement.cljc

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
[db id]
1616
(if-not (db/get-table db id)
1717
db
18-
(update db :iql/tables dissoc id)))
18+
(update db :gensql/tables dissoc id)))
1919

2020
(defn safe-drop-table
2121
[db id]
2222
(when (db/safe-get-table db id)
23-
(update db :iql/tables dissoc id)))
23+
(update db :gensql/tables dissoc id)))
2424

2525
(defn drop-model
2626
[db id]
2727
(if-not (db/get-model db id)
2828
db
29-
(update db :iql/models dissoc id)))
29+
(update db :gensql/models dissoc id)))
3030

3131
(defn safe-drop-model
3232
[db id]
3333
(when (db/safe-get-model db id)
34-
(update db :iql/models dissoc id)))
34+
(update db :gensql/models dissoc id)))
3535

3636
(defn execute
3737
[node db]

0 commit comments

Comments
 (0)