vibe-d-postgresql 3.0.0-rc.2

PostgreSQL support for Vibe.d


To use this package, run the following command in your project's root directory:

PostgreSQL support for Vibe.d

API documentation

Please help us to make documentation better!

Example:

module vibe.db.postgresql.example;

import vibe.d;
import vibe.db.postgresql;

PostgresClient client;

void test()
{
    client.pickConnection(
        (scope conn)
        {
            immutable result = conn.execStatement(
                "SELECT 123 as first_num, 567 as second_num, 'abc'::text as third_text "~
                "UNION ALL "~
                "SELECT 890, 233, 'fgh'::text as third_text",
                ValueFormat.BINARY
            );

            assert(result[0]["second_num"].as!PGinteger == 567);
            assert(result[1]["third_text"].as!PGtext == "fgh");

            foreach (val; rangify(result[0]))
                logInfo("Found entry: %s", val.as!Bson.toJson);
        }
    );
}

static this()
{
    // params: conninfo string, maximum number of connections in
    // the connection pool
    client = new PostgresClient("dbname=postgres user=postgres", 4);

    test();

    logInfo("Done!");
}

Output:

[main(----) INF] Found entry: 123
[main(----) INF] Found entry: 567
[main(----) INF] Found entry: "abc"
[main(----) INF] Done!
Authors:
  • Denis Feklushkin <denis.feklushkin@gmail.com>
Sub packages:
vibe-d-postgresql:example
Dependencies:
dpq2, vibe-d:core
Versions:
3.0.0-rc.2 2019-May-29
3.0.0-rc.1 2019-May-27
2.0.3 2019-Apr-18
2.0.2 2019-Mar-05
2.0.2-alpha.1 2019-Feb-04
Show all 55 versions
Download Stats:
  • 8 downloads today

  • 150 downloads this week

  • 673 downloads this month

  • 17664 downloads total

Score:
3.9
Short URL:
vibe-d-postgresql.dub.pm