doltlite 0.11.18-aarch64-linux → 0.11.19-aarch64-linux
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 +4 -4
- data/README.md +5 -1
- data/lib/doltlite/database.rb +8 -5
- data/lib/doltlite/version.rb +1 -1
- data/vendor/libdoltlite/libdoltlite.so +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8d4e761a1a859f36c869470be2343a479dd6cc5af05bd8a3d0eaeffc72b0232
|
|
4
|
+
data.tar.gz: bf49485679bfea65873345eab6baf582e79678a5f5b4aea1ec139778bb62ce5e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7f7e0595346969154989eee6e4e1d547b8df09c7c8a4ead2539520522b4ded50cf32ed88aed9ed85444efda662356f01e5ca02c07c03822ab42a06bb45b48faa
|
|
7
|
+
data.tar.gz: 2f0f3106961e81bfae8f1a1ce0ee57d672e030a78803c0af114bad6a0d70d8e35be5ebebf634b6f7072bcc6e03f141647567be8cb87e6a8688d018922054ade9
|
data/README.md
CHANGED
|
@@ -25,7 +25,9 @@ db = Doltlite.open("app.db") # or ":memory:"
|
|
|
25
25
|
db.execute("CREATE TABLE notes(id INTEGER PRIMARY KEY, body TEXT)")
|
|
26
26
|
db.execute("INSERT INTO notes(body) VALUES (?)", "first note")
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
# A Dolt version-control commit (a new entry in dolt_log) — not a SQL
|
|
29
|
+
# transaction COMMIT. Equivalent to db.execute("SELECT dolt_commit('-A','-m',...)").
|
|
30
|
+
hash = db.dolt_commit(message: "add first note")
|
|
29
31
|
puts "committed #{hash}"
|
|
30
32
|
|
|
31
33
|
db.query("SELECT commit_hash, message FROM dolt_log").each do |commit_hash, message|
|
|
@@ -38,6 +40,8 @@ db.close
|
|
|
38
40
|
`execute`/`query` take positional bind values (`?`) and return rows as arrays of
|
|
39
41
|
column values. The `dolt_*` functions and virtual tables (`dolt_log`,
|
|
40
42
|
`dolt_status`, `dolt_diff`, `dolt_branches`, ...) are invoked through SQL.
|
|
43
|
+
`dolt_commit` is the version-control commit that adds to `dolt_log` — distinct
|
|
44
|
+
from a SQL transaction commit.
|
|
41
45
|
|
|
42
46
|
## License
|
|
43
47
|
|
data/lib/doltlite/database.rb
CHANGED
|
@@ -40,17 +40,20 @@ module Doltlite
|
|
|
40
40
|
end
|
|
41
41
|
alias query execute
|
|
42
42
|
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
|
|
43
|
+
# Make a Dolt version-control commit: SELECT dolt_commit(...). This is the
|
|
44
|
+
# version-control operation (a new entry in dolt_log), NOT a SQL
|
|
45
|
+
# transaction COMMIT. Stages everything when all is true. Returns the new
|
|
46
|
+
# commit hash.
|
|
47
|
+
def dolt_commit(message:, all: true)
|
|
46
48
|
args = all ? ["-A", "-m", message] : ["-m", message]
|
|
47
49
|
placeholders = (["?"] * args.length).join(", ")
|
|
48
50
|
rows = execute("SELECT dolt_commit(#{placeholders})", *args)
|
|
49
51
|
rows.dig(0, 0)
|
|
50
52
|
end
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
# The doltlite version string (SELECT dolt_version()).
|
|
55
|
+
def dolt_version
|
|
56
|
+
execute("SELECT dolt_version()").dig(0, 0)
|
|
54
57
|
end
|
|
55
58
|
|
|
56
59
|
def close
|
data/lib/doltlite/version.rb
CHANGED
|
Binary file
|