db-postgres 0.8.0 → 0.9.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 +4 -4
- checksums.yaml.gz.sig +2 -5
- data/context/getting-started.md +37 -0
- data/context/index.yaml +12 -0
- data/lib/db/postgres/connection.rb +16 -0
- data/lib/db/postgres/version.rb +1 -1
- data/readme.md +8 -0
- data/releases.md +5 -0
- data.tar.gz.sig +0 -0
- metadata +21 -9
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dda5680ffcdd6de60c833681366779e9859e497ae9b367d3bcf3a84c68f15771
|
4
|
+
data.tar.gz: c9d19d688ed762c97539318765b149e477d47e0cf374b774810cd0cd830336ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a50d56b3495fa91827ff03e1cf9da2667819f3b23e982ed2619bf5633e53222fc09218e4526c3941ee906b65976c8d1796499405a4f2b85cf3cb3ccce20de58c
|
7
|
+
data.tar.gz: 68c172f739f907eca43c9270c9053ce1e0ab4d33da5c8dbcf75852e73bcb4da7d52233abcf44ef628afccfa011d2d8032391e17eec28a4a27eaacf0d59fc7c53
|
checksums.yaml.gz.sig
CHANGED
@@ -1,5 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
�Z�-ʆ��
|
4
|
-
�
|
5
|
-
d4�����N���3��"%ĩ��TuC�
|
1
|
+
�_��N@Z o�3����C*ɡ�e\��o�'h}��<�a�n�316P�?�E#5��>z_��"��
|
2
|
+
Ĭ9o%:�Fc>�������~�%~v�H9���eE2��u��+_�b��A�q��=O�������d�fۀ1��y�lA�̮�C$$�Lp���pŠu��>CZ����z���?}�b� mx��W�cɄў#�Fp��_�;�^��Φ
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Getting Started
|
2
|
+
|
3
|
+
This guide explains how to get started with the `db-postgres` gem.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add the gem to your project:
|
8
|
+
|
9
|
+
~~~ bash
|
10
|
+
$ bundle add db-postgres
|
11
|
+
~~~
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
Here is an example of the basic usage of the adapter:
|
16
|
+
|
17
|
+
~~~ ruby
|
18
|
+
require 'async'
|
19
|
+
require 'db/postgres'
|
20
|
+
|
21
|
+
# Create an event loop:
|
22
|
+
Sync do
|
23
|
+
# Create the adapter and connect to the database:
|
24
|
+
adapter = DB::Postgres::Adapter.new(database: 'test')
|
25
|
+
connection = adapter.call
|
26
|
+
|
27
|
+
# Execute the query:
|
28
|
+
result = connection.send_query("SELECT VERSION()")
|
29
|
+
|
30
|
+
# Get the results:
|
31
|
+
pp connection.next_result.to_a
|
32
|
+
# => [["PostgreSQL 16.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 14.1.1 20240522, 64-bit"]]
|
33
|
+
ensure
|
34
|
+
# Return the connection to the client connection pool:
|
35
|
+
connection.close
|
36
|
+
end
|
37
|
+
~~~
|
data/context/index.yaml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Automatically generated context index for Utopia::Project guides.
|
2
|
+
# Do not edit then files in this directory directly, instead edit the guides and then run `bake utopia:project:agent:context:update`.
|
3
|
+
---
|
4
|
+
description: Ruby FFI bindings for libpq C interface.
|
5
|
+
metadata:
|
6
|
+
documentation_uri: https://socketry.github.io/db-postgres/
|
7
|
+
funding_uri: https://github.com/sponsors/ioquatix
|
8
|
+
source_code_uri: https://github.com/socketry/db-postgres.git
|
9
|
+
files:
|
10
|
+
- path: getting-started.md
|
11
|
+
title: Getting Started
|
12
|
+
description: This guide explains how to get started with the `db-postgres` gem.
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# Copyright, 2018-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
require 'async/pool/resource'
|
7
|
+
require 'db/features'
|
7
8
|
require_relative 'native/connection'
|
8
9
|
|
9
10
|
module DB
|
@@ -104,6 +105,21 @@ module DB
|
|
104
105
|
def next_result
|
105
106
|
@native.next_result
|
106
107
|
end
|
108
|
+
|
109
|
+
FEATURES = DB::Features.new(
|
110
|
+
alter_column_type: true,
|
111
|
+
using_clause: true,
|
112
|
+
conditional_operations: true,
|
113
|
+
transactional_schema: true,
|
114
|
+
batch_alter_table: true,
|
115
|
+
concurrent_schema: true,
|
116
|
+
serial_columns: true,
|
117
|
+
)
|
118
|
+
|
119
|
+
# Database feature detection for migration and query building.
|
120
|
+
def features
|
121
|
+
FEATURES
|
122
|
+
end
|
107
123
|
end
|
108
124
|
end
|
109
125
|
end
|
data/lib/db/postgres/version.rb
CHANGED
data/readme.md
CHANGED
@@ -10,6 +10,14 @@ Please see the [project documentation](https://socketry.github.io/db-postgres/)
|
|
10
10
|
|
11
11
|
- [Getting Started](https://socketry.github.io/db-postgres/guides/getting-started/index) - This guide explains how to get started with the `db-postgres` gem.
|
12
12
|
|
13
|
+
## Releases
|
14
|
+
|
15
|
+
Please see the [project releases](https://socketry.github.io/db-postgres/releases/index) for all releases.
|
16
|
+
|
17
|
+
### v0.9.0
|
18
|
+
|
19
|
+
- Add support for `DB::Features`.
|
20
|
+
|
13
21
|
## Contributing
|
14
22
|
|
15
23
|
We welcome contributions to this project.
|
data/releases.md
ADDED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: db-postgres
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
- Aidan Samuel
|
9
9
|
- Tony Schneider
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain:
|
13
12
|
- |
|
@@ -39,7 +38,7 @@ cert_chain:
|
|
39
38
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
40
39
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
41
40
|
-----END CERTIFICATE-----
|
42
|
-
date:
|
41
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
43
42
|
dependencies:
|
44
43
|
- !ruby/object:Gem::Dependency
|
45
44
|
name: async-pool
|
@@ -55,6 +54,20 @@ dependencies:
|
|
55
54
|
- - ">="
|
56
55
|
- !ruby/object:Gem::Version
|
57
56
|
version: '0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: db
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0.14'
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0.14'
|
58
71
|
- !ruby/object:Gem::Dependency
|
59
72
|
name: ffi-native
|
60
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,12 +82,12 @@ dependencies:
|
|
69
82
|
- - "~>"
|
70
83
|
- !ruby/object:Gem::Version
|
71
84
|
version: '0.4'
|
72
|
-
description:
|
73
|
-
email:
|
74
85
|
executables: []
|
75
86
|
extensions: []
|
76
87
|
extra_rdoc_files: []
|
77
88
|
files:
|
89
|
+
- context/getting-started.md
|
90
|
+
- context/index.yaml
|
78
91
|
- lib/db/postgres.rb
|
79
92
|
- lib/db/postgres/adapter.rb
|
80
93
|
- lib/db/postgres/connection.rb
|
@@ -87,6 +100,7 @@ files:
|
|
87
100
|
- lib/db/postgres/version.rb
|
88
101
|
- license.md
|
89
102
|
- readme.md
|
103
|
+
- releases.md
|
90
104
|
homepage: https://github.com/socketry/db-postgres
|
91
105
|
licenses:
|
92
106
|
- MIT
|
@@ -94,7 +108,6 @@ metadata:
|
|
94
108
|
documentation_uri: https://socketry.github.io/db-postgres/
|
95
109
|
funding_uri: https://github.com/sponsors/ioquatix
|
96
110
|
source_code_uri: https://github.com/socketry/db-postgres.git
|
97
|
-
post_install_message:
|
98
111
|
rdoc_options: []
|
99
112
|
require_paths:
|
100
113
|
- lib
|
@@ -102,15 +115,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
115
|
requirements:
|
103
116
|
- - ">="
|
104
117
|
- !ruby/object:Gem::Version
|
105
|
-
version: '3.
|
118
|
+
version: '3.2'
|
106
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
120
|
requirements:
|
108
121
|
- - ">="
|
109
122
|
- !ruby/object:Gem::Version
|
110
123
|
version: '0'
|
111
124
|
requirements: []
|
112
|
-
rubygems_version: 3.
|
113
|
-
signing_key:
|
125
|
+
rubygems_version: 3.6.9
|
114
126
|
specification_version: 4
|
115
127
|
summary: Ruby FFI bindings for libpq C interface.
|
116
128
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|