All Projects → denizzzka → vibe.d.db.postgresql

denizzzka / vibe.d.db.postgresql

Licence: MIT license
PostgreSQL support for Vibe.d

Programming Languages

d
599 projects

Projects that are alternatives of or similar to vibe.d.db.postgresql

vibe
Having a bad day? Good boy doggo to the rescue. Vibe for 30 seconds!!
Stars: ✭ 15 (+0%)
Mutual labels:  vibe
diskuto
An embeddable comment engine
Stars: ✭ 35 (+133.33%)
Mutual labels:  vibe
alexa-openwebif
alexa skill to control your openwebif device
Stars: ✭ 25 (+66.67%)
Mutual labels:  vibe
spotify-vibe-check
Spotify Vibe Checker Web App to vibe check your Spotify Playlists! (currently broken due to CORS)
Stars: ✭ 24 (+60%)
Mutual labels:  vibe

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!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].