vibe-d-postgresql 0.3.0-beta.2

PostgreSQL support for Vibe.d


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

Manual usage
Put the following dependency into your project's dependences section:

PostgreSQL support for Vibe.d

Example:

module vibe.db.postgresql.example;

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

PostgresClient client;

void test()
{
    auto conn = client.lockConnection();
    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
    );
    delete conn;

    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();
}

Output:

Found entry: 123
Found entry: 567
Found entry: "abc"
Authors:
  • Denis Feklushkin <denis.feklushkin@gmail.com>
Sub packages:
vibe-d-postgresql:example
Dependencies:
dpq2, vibe-d:core
Versions:
3.1.0-rc.1 2020-Sep-07
3.0.1 2020-Aug-30
3.0.0 2020-Jun-12
3.0.0-rc.2 2019-May-29
3.0.0-rc.1 2019-May-27
Show all 61 versions
Download Stats:
  • 25 downloads today

  • 140 downloads this week

  • 922 downloads this month

  • 27158 downloads total

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