ask-state-providers 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4af42039dcfbb213799ab09a162acb60c1e78f1b09cb94e52d9dd2bece7b18c
|
|
4
|
+
data.tar.gz: b0deb44a8f91e0c6cc36dcabf279d822b08386ef49854225b78dc4955cc723b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53bf5a675035408f401a354f0ee3c778ac1c23dcd9115d54b192e65ddcd3df7b64a6ff0bf69aa9cc9b879cf7b485ed59ce2a79da15d8cee9b07688b03a66d5b1
|
|
7
|
+
data.tar.gz: '09c163faa51ecfb38db57c93fcd33752213e8cfe4367706167cabf3e54130b88b7b6dfebd9e9ee14571b30ac839418fac3fafa06daccf9ae5729739d4716f7e1'
|
data/lib/ask/state/memory.rb
CHANGED
|
@@ -293,6 +293,12 @@ module Ask
|
|
|
293
293
|
|
|
294
294
|
# -- lifecycle --
|
|
295
295
|
|
|
296
|
+
# Idempotent setup — creates tables if they don't exist.
|
|
297
|
+
# Called automatically on initialize. Safe to call multiple times.
|
|
298
|
+
def setup!
|
|
299
|
+
@pool.with { |conn| conn.exec(MIGRATIONS) }
|
|
300
|
+
end
|
|
301
|
+
|
|
296
302
|
def close
|
|
297
303
|
@pool&.shutdown { |c| c.close }
|
|
298
304
|
end
|
|
@@ -272,6 +272,14 @@ module Ask
|
|
|
272
272
|
|
|
273
273
|
# -- lifecycle --
|
|
274
274
|
|
|
275
|
+
# Idempotent setup — creates tables if they don't exist.
|
|
276
|
+
# Called automatically on initialize. Safe to call multiple times.
|
|
277
|
+
def setup!
|
|
278
|
+
@mutex.synchronize do
|
|
279
|
+
migrate
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
|
|
275
283
|
def close
|
|
276
284
|
@mutex.synchronize do
|
|
277
285
|
@db.close
|