File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ ~~~
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 55
66module DB
77 module Postgres
8- VERSION = "0.8 .0"
8+ VERSION = "0.9 .0"
99 end
1010end
Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ Please see the [project documentation](https://socketry.github.io/db-postgres/)
1212
1313## Releases
1414
15- There are no documented releases.
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 ` .
1620
1721## Contributing
1822
Original file line number Diff line number Diff line change 11# Releases
22
3- ## Unreleased
3+ ## v0.9.0
44
55 - Add support for ` DB::Features ` .
You can’t perform that action at this time.
0 commit comments