Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Structs PostgresClient

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module juptune.postgres.client;

struct PostgresClient
{
    /++ STRUCTS ++/
    
    /// Intentionally public for documentation - PLEASE do not use this directly, only use .rowScanner 
    struct RowScanner(ReturnValues...)
    {
        /++ ALIASES ++/
        
        ///
        alias Pointer(T) = T*;
        ///
        alias ReturnValuePointers = ;
        
        /++ FUNCTIONS ++/
        
        /// Executes a query, and for each row it will scan the data into previously provided value set, calling onRow after each row has been scanned. 
        Result query(QueryArgs...)(const char[] query, QueryArgs args, Result function() onRow);
        /// ditto. 
        Result queryGc(QueryArgs...)(const char[] query, QueryArgs args, Result function() onRow);
        ///
        Result queryImpl(bool Once, HandlerT, QueryArgs...)(const char[] query, QueryArgs args, HandlerT onRow);
        /// Functions mostly the same as query , with a few distinct changes. 
        Result queryRow(QueryArgs...)(const char[] query, QueryArgs args);
        
        /++ VARIABLES ++/
        
        ///
        ReturnValuePointers _pointers;
        ///
        PostgresProtocol* _protocol;
    }
    
    /++ ALIASES ++/
    
    ///
    alias __xdtor = __MARMOS_BUG__;
    
    /++ FUNCTIONS ++/
    
    /// Exactly the same as PostgresProtocol.connect 
    Result connect(IpAddress address, PostgresConnectInfo connectInfo);
    /// Executes a query without reading in any of its returned rows. 
    Result exec(QueryArgs...)(const char[] query, QueryArgs args);
    ///
    PostgresClient opAssign(PostgresClient p);
    /// Returns: The underlying PostgresProtocol , for certain use cases this higher-level client doesn't provide. 
    PostgresProtocol protocol()scope ;
    /// Constructs a row scanner that'll read any returned rows into the provided set of values. 
     rowScanner(ReturnValues...)(ReturnValues values);
    
}

Documentation

A higher-level wrapper around PostgresProtocolthat makes it much easier to convert D types into their respective Postgres wire format, and vice-versa.

Most code should be using this instead of PostgresProtocol.

Usage

First, call .connectto connect and authenticate against a postgres instance.

If you want to execute a query without handling any return results, then use .execand .execGc.

If you want to execute a query and handle a single returned row, use .rowScanner().queryRow.

If you want to execute a query and handle multiple returned rows, use .rowScanner().queryand .rowScanner().queryGc.

If you want to execute multiple statements in one query, please use .protocolto access the underlying PostgresProtocol, and then call .simpleQueryon it.

Aliases

Name Description
__xdtor

Functions

Name Description
connect

Exactly the same as PostgresProtocol.connect

exec

Executes a query without reading in any of its returned rows.

opAssign
protocol

Returns: The underlying PostgresProtocol, for certain use cases this higher-level client doesn't provide.

rowScanner

Constructs a row scanner that'll read any returned rows into the provided set of values.

Structs

Name Description
RowScanner

Intentionally public for documentation - PLEASE do not use this directly, only use .rowScanner