<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 12, 2016 at 10:31 AM, Suliman via Digitalmars-d-announce <span dir="ltr"><<a href="mailto:digitalmars-d-announce@puremagic.com" target="_blank">digitalmars-d-announce@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Monday, 15 February 2016 at 22:50:56 UTC, Piotr Szturmaj wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 2016-02-14 20:48, Eugene Wissner wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think may be we should discuss if we can/should change something in<br>
ddb. I think there were some interesting and promising ideas in this<br>
discussion. Maybe split the PostgreSQL driver and develop it seperately<br>
and use an interface more similar to JDBC. Maybe some kind of coworking<br>
with ddbc is possible to get more developers together; maybe Suliman has<br>
some thoughts on it.<br>
</blockquote>
<br>
I added you and Jacob as collaborators. Please do what you think is right. Thanks.<br>
</blockquote>
<br></div></div>
Could anybody help me to understand how to get data as ubyte?<br>
<br>
I found this places in sources.<br>
<a href="https://github.com/pszturmaj/ddb/commit/29070ef90ba8f8d658be50a5da4aa3c96d0cdd5a" rel="noreferrer" target="_blank">https://github.com/pszturmaj/ddb/commit/29070ef90ba8f8d658be50a5da4aa3c96d0cdd5a</a><br>
<a href="https://github.com/pszturmaj/ddb/commit/a66ff5a6aa7008235f28cce167d0ae42cc4f4df3" rel="noreferrer" target="_blank">https://github.com/pszturmaj/ddb/commit/a66ff5a6aa7008235f28cce167d0ae42cc4f4df3</a><br>
<br>
But I can't understand how to use it.<br>
<br>
My code is next:<br>
<br>
        auto cmd = new PGCommand(conn);<br>
        <br>
        cmd.query = `SELECT name, userblob FROM "USERS" ;`;<br>
        <br>
        ubyte [] x;<br>
        <br>
        try {<br>
       auto result = cmd.executeQuery;<br>
        <br>
           foreach (row; result)<br>
           {<br>
                writeln(row[0]);<br>
                x = row[1].get!(ubyte);<br>
           }<br>
        <br>
    }<br>
    catch (ServerErrorException e) {<br>
        // Probably table does not exist - ignore<br>
    }<br>
<br>
<br>
But I am getting error:<br>
<br>
source\app.d(28,13): Error: cannot implicitly convert expression (( VariantN!20u __tmpfordtor3893 = row.opIndex(1u);<br>
 , __tmpfordtor3893).get()) of type ubyte to ubyte[]<br>
dmd failed with exit code 1.<br>
<br>
<br>
<br>
<br>
</blockquote></div><br></div><div class="gmail_extra">Hi,</div><div class="gmail_extra"><br></div><div class="gmail_extra">In your example x is a ubyte[] and you get!(ubyte).</div><div class="gmail_extra"><br></div><div class="gmail_extra">x should be a ubyte, however from your sql query I'd assume you actually mean to use .get!(ubyte[])</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>