Thread overview
dpq2: spurious error message
Feb 13, 2018
Nicholas Wilson
Feb 13, 2018
Nicholas Wilson
Feb 13, 2018
Nicholas Wilson
February 13, 2018
import vibe.vibe;
import vibe.db.postgresql;

QueryParams p;
p.sqlCommand = "select title,url,url_title,messagebody,generationtime from items order by generationtime;";
auto _items = conn.execParams(p);

struct Range
{
     immutable Answer a;
      size_t i;
      immutable(Row) front() { return a[i]; }
      @property void popFront() { i++; }
      bool empty() { return i == a.length; }
}
auto items = Range(_items,0);
res.render!("items.dt", items); // usual vibe.d function

//items.dt
- import std.datetime.date;
- import dpq2.conv.time;
- import dpq2.conv.to_d_types;
- foreach(i; items)
    item
        title= i["title"].as!string
        link= i["url"].as!string
        description= i["messagebody"].as!string
        pubDate= DateTimeToRfc822String(i["generationTime"].as!DateTime)

I get the following _two_ lots of the following error (between the ----):
Compiling Diet HTML template rss.dt...
-----
dpq2-1.0.0-alpha.7/dpq2/src/dpq2/conv/to_bson.d(143,23): Error: none of the overloads of '__ctor' are callable using argument types (UUID), candidates are:
vibe-d-0.7.32/vibe-d/source/vibe/data/bson.d(148,2):        vibe.data.bson.Bson.this(Type type, immutable(ubyte)[] data)
vibe-d-0.7.32/vibe-d/source/vibe/data/bson.d(185,2):        vibe.data.bson.Bson.this(double value)
vibe-d-0.7.32/vibe-d/source/vibe/data/bson.d(187,2):        vibe.data.bson.Bson.this(string value, Type type = cast(Type)cast(ubyte)2u)
vibe-d-0.7.32/vibe-d/source/vibe/data/bson.d(194,2):        vibe.data.bson.Bson.this(const(Bson[string]) value)
vibe-d-0.7.32/vibe-d/source/vibe/data/bson.d(196,2):        vibe.data.bson.Bson.this(const(Bson[]) value)
dpq2-1.0.0-alpha.7/dpq2/src/dpq2/conv/to_bson.d(143,23):        ... (10 more, -v to show) ...
-----
const(ubyte[]) Is not tested in integration tests!
UUID Is not tested in integration tests!
TTimeStamp!false Is not tested in integration tests!
Json Is not tested in integration tests!


Is this a problem with the library or me? Can I work around it? How?

Thanks
Nic
February 13, 2018
On Tuesday, 13 February 2018 at 17:08:24 UTC, Nicholas Wilson wrote:
> Is this a problem with the library or me? Can I work around it? How?
>
> Thanks
> Nic

So digging around in the library code, commenting it out seems to work for now as I don't use UUIDs. Error didn't originate from my code because it wasn't a template. I'm still surprised that it built and then errored in my code.
February 13, 2018
On Tuesday, 13 February 2018 at 17:17:41 UTC, Nicholas Wilson wrote:
> On Tuesday, 13 February 2018 at 17:08:24 UTC, Nicholas Wilson wrote:
>> Is this a problem with the library or me? Can I work around it? How?
>>
>> Thanks
>> Nic
>
> So digging around in the library code, commenting it out seems to work for now as I don't use UUIDs. Error didn't originate from my code because it wasn't a template. I'm still surprised that it built and then errored in my code.

Ahh it requires vibe.d 0.8.2