dpq2: spurious error message

Nicholas Wilson iamthewilsonator at hotmail.com
Tue Feb 13 17:08:24 UTC 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


More information about the Digitalmars-d-learn mailing list