File tree 2 files changed +10
-10
lines changed
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 29
29
{:client
30
30
{:sql
31
31
{:stdio
32
- {:command "psql -U blogger postgres"
32
+ {:command "psql postgres://postgres:postgres@localhost/ postgres"
33
33
:prompt_pattern "=> " }}}})
34
34
35
35
(when (config.get - in [:mapping :enable_defaults])
47
47
48
48
(def buf - suffix ".sql" )
49
49
(def comment- prefix "-- " )
50
+
50
51
;; Rough equivalent of a Lisp form.
51
52
(defn form - node ? [node ]
52
53
(or (= "statement" (node:type ))))
54
+
53
55
;; Comment nodes are comment (--) and marginalia (/*...*/)
54
56
(defn comment- node ? [node ]
55
57
(or (= "comment" (node:type ))
56
- (= "marginalia" (node:type ))
57
- ))
58
+ (= "marginalia" (node:type ))))
58
59
59
60
(defn - with - repl -or- warn [f opts ]
60
61
(let [repl (state :repl)]
82
83
(with - repl -or- warn
83
84
(fn [repl ]
84
85
(repl.send
85
- (.. opts.code "\n " )
86
+ (.. opts.code "; \n " )
86
87
(fn [msgs ]
87
88
(let [msgs (-> list msgs )]
88
89
(when opts.on - result
116
117
(a.assoc (state ) :repl nil ))))
117
118
118
119
(defn start []
119
- (log.append [(.. comment- prefix "start [] " )])
120
+ (log.append [(.. comment- prefix "Strting SQL client... " )])
120
121
(if (state :repl)
121
122
(log.append [(.. comment- prefix "Can't start, REPL is already running." )
122
123
(.. comment- prefix "Stop the REPL with "
148
149
149
150
:on-stray-output
150
151
(fn [msg ]
151
- (display - result msg ))
152
- })))))
152
+ (display - result msg ))})))))
153
153
154
154
(defn on - load []
155
155
(when (config.get - in [:client_on_load])
You can’t perform that action at this time.
0 commit comments