On Tuesday, 12 April 2016 at 08:47:43 UTC, Rory McGuire wrote:
On Tue, Apr 12, 2016 at 10:31 AM, Suliman via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote:

On Monday, 15 February 2016 at 22:50:56 UTC, Piotr Szturmaj wrote:

On 2016-02-14 20:48, Eugene Wissner wrote:

I think may be we should discuss if we can/should change something in ddb. I think there were some interesting and promising ideas in this discussion. Maybe split the PostgreSQL driver and develop it seperately and use an interface more similar to JDBC. Maybe some kind of coworking with ddbc is possible to get more developers together; maybe Suliman has some thoughts on it.

I added you and Jacob as collaborators. Please do what you think is right. Thanks.

Could anybody help me to understand how to get data as ubyte?

I found this places in sources.



But I can't understand how to use it.

My code is next:

        auto cmd = new PGCommand(conn);

        cmd.query = `SELECT name, userblob FROM "USERS" ;`;

        ubyte [] x;

        try {
       auto result = cmd.executeQuery;

           foreach (row; result)
                x = row[1].get!(ubyte);

    catch (ServerErrorException e) {
        // Probably table does not exist - ignore

But I am getting error:

source\app.d(28,13): Error: cannot implicitly convert expression ((
VariantN!20u __tmpfordtor3893 = row.opIndex(1u);
 , __tmpfordtor3893).get()) of type ubyte to ubyte[]
dmd failed with exit code 1.


In your example x is a ubyte[] and you get!(ubyte).

x should be a ubyte, however from your sql query I'd assume you actually
mean to use .get!(ubyte[])

I need to get binary blob. It's storage in PG as `bytea`. Could you show example how to get data from this field?

Reply via email to