duckdb 1.1.0.0 → 1.1.0.1
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/.github/workflows/test_on_macos.yml +1 -1
- data/.github/workflows/test_on_ubuntu.yml +1 -1
- data/.github/workflows/test_on_windows.yml +1 -1
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/README.md +12 -0
- data/lib/duckdb/connection.rb +9 -0
- data/lib/duckdb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 874174344b2be8ad2eba6fa1e89d2c96827a7e53e0982bacaa7a804b1ee8cf0b
|
4
|
+
data.tar.gz: 9d57293bc3dc59cc10ad7a23ae8e0b8ed4944524c83ecd3e5e9503c6f460d73f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8739a162ec00fb0bb98e13d4f9adecb8f3230e2b4fa81067a128ce4f9db4456b76fe825652ba09b46a5c05fb1f7637a762f369f28f9d7d9423649f7e646b7f0
|
7
|
+
data.tar.gz: 3b564b2aa68cbfcc5eec96d9cc4dd038749d172b28b2329ba20af14610bc1db34a270d3034688dfdf852b26edd0a711d803886e3d731619848d5cd5e6ca331be
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
|
+
# Unreleased
|
5
|
+
|
6
|
+
# 1.1.0.1 - 2024-09-21
|
7
|
+
- add `DuckDB::Connection#prepare`. `DuckDB::Connection#prepare` is an alias of `DuckDB::Connection#prepared_statement`.
|
4
8
|
|
5
9
|
# 1.1.0.0 - 2024-09-15
|
6
10
|
- drop ruby 3.0.x.
|
@@ -31,7 +35,7 @@ All notable changes to this project will be documented in this file.
|
|
31
35
|
## Breaking changes
|
32
36
|
- drop duckdb v0.9.x.
|
33
37
|
- skip to check duckdb_parameter_name is available.
|
34
|
-
- The following methods are
|
38
|
+
- The following methods are obsoleted.
|
35
39
|
- `DuckDB::Result#_null?`
|
36
40
|
- `DuckDB::Result#_to_boolean`
|
37
41
|
- `DuckDB::Result#_to_smallint`
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -113,7 +113,19 @@ con.query('SELECT * FROM users WHERE name = ? AND email = ?', 'Alice', 'alice@ex
|
|
113
113
|
# or
|
114
114
|
con.query('SELECT * FROM users WHERE name = $name AND email = $email', name: 'Alice', email: 'alice@example.com')
|
115
115
|
```
|
116
|
+
### Using prepared statement
|
116
117
|
|
118
|
+
You can use prepared statement.
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
stmt = con.prepare('SELECT * FROM users WHERE name = $name AND email = $email')
|
122
|
+
# or
|
123
|
+
# stmt = con.prepared_statement('SELECT * FROM users WHERE name = $name AND email = $email')
|
124
|
+
# or
|
125
|
+
# stmt = DuckDB::PreparedStatement.new(con, 'SELECT * FROM users WHERE name = $name AND email = $email')
|
126
|
+
stmt.bind(name: 'Alice', email: 'alice@example.com')
|
127
|
+
result = stmt.execute
|
128
|
+
```
|
117
129
|
### Using async query
|
118
130
|
|
119
131
|
You can use async query.
|
data/lib/duckdb/connection.rb
CHANGED
@@ -97,6 +97,14 @@ module DuckDB
|
|
97
97
|
# returns PreparedStatement object.
|
98
98
|
# The first argument is SQL string.
|
99
99
|
#
|
100
|
+
# require 'duckdb'
|
101
|
+
# db = DuckDB::Database.open('duckdb_file')
|
102
|
+
# con = db.connect
|
103
|
+
#
|
104
|
+
# sql = 'SELECT * FROM users WHERE name = $name AND email = $email'
|
105
|
+
# stmt = con.prepared_statement(sql)
|
106
|
+
# stmt.bind_args(name: 'Dave', email: 'dave@example.com')
|
107
|
+
# result = stmt.execute
|
100
108
|
def prepared_statement(str)
|
101
109
|
PreparedStatement.new(self, str)
|
102
110
|
end
|
@@ -126,5 +134,6 @@ module DuckDB
|
|
126
134
|
alias async_execute async_query
|
127
135
|
alias open connect
|
128
136
|
alias close disconnect
|
137
|
+
alias prepare prepared_statement
|
129
138
|
end
|
130
139
|
end
|
data/lib/duckdb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duckdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.
|
4
|
+
version: 1.1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaki Suketa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bigdecimal
|