On Saturday, 24 February 2018 at 18:56:23 UTC, Denis F wrote:
On Saturday, 24 February 2018 at 05:45:45 UTC, rikki cattermole
wrote:
There is plenty of desire to build a generalized SQL interface
for Phobos.
But somebody needs to do it and it won't be all that much fun
to do.
I want to dwel
On Saturday, 24 February 2018 at 05:45:45 UTC, rikki cattermole
wrote:
There is plenty of desire to build a generalized SQL interface
for Phobos.
But somebody needs to do it and it won't be all that much fun
to do.
Hi Joe and Rikki,
This is the goal of my dstddb project and I've picked it u
On Saturday, 16 April 2016 at 14:50:07 UTC, ag0aep6g wrote:
On 16.04.2016 02:56, Erik Smith wrote:
I'm getting a strange assertion/crash involving RefCounted and
I've
reduced it down to the isolated case (see below). This is
with D 2.071
and requires this version to compile.
Seems to work w
I'm getting a strange assertion/crash involving RefCounted and
I've reduced it down to the isolated case (see below). This is
with D 2.071 and requires this version to compile.
I'm wondering if there is something I wrong in the way I'm using
RefCounted. I'm using using it to pass RC value t
On Wednesday, 30 March 2016 at 15:42:05 UTC, Nikitas Leogas wrote:
I'm new to D, but considering using it in a new project, which
will need to connect to MS SQL Server and Sybase ASE databases.
I've successfully used FreeTDS for this purpose in the past, so
I was looking for the corresponding D
I've made a few updates based on some of the feedback in this
thread.
- execute() renamed to query()
- query with input binds directly from connection
- query() returns result for chaining
The design is still early stage. I've got a growing list of
design options which I'll bring into discuss
On Sunday, 6 March 2016 at 08:53:05 UTC, Kagamin wrote:
On Saturday, 5 March 2016 at 18:00:56 UTC, Erik Smith wrote:
I'm definitely going to start working in async capability (or
more accurately, non-blocking) into the interface.
Huh? Non-blocking operation is not reflected in interface. Only
On Saturday, 5 March 2016 at 13:13:09 UTC, Jacob Carlborg wrote:
On 2016-03-05 11:23, Saurabh Das wrote:
A little late to the party, nevertheless: Thanks for doing
this, it will
be super-helpful!
My only feature request will be: please make it work with
minimal effort
with Vibe.D! :)
Yeah
On Friday, 4 March 2016 at 22:44:24 UTC, Sebastiaan Koppe wrote:
On Friday, 4 March 2016 at 18:42:45 UTC, Erik Smith wrote:
auto db = createDatabase("file:///testdb");
auto rowSet = db.connection().statement("select name,score
from score").execute;
foreach (r; rowSet)
writeln(r[0].
On Friday, 4 March 2016 at 16:54:33 UTC, Kagamin wrote:
On Thursday, 3 March 2016 at 17:46:02 UTC, Erik Smith wrote:
BTW in the oracle driver you use that ODBC idiom of passing
strings as pointer+length pairs. Why don't you use it in ODBC
driver?
That will be fixed in the next push.
erik
On Friday, 4 March 2016 at 19:27:47 UTC, Bubbasaur wrote:
On Friday, 4 March 2016 at 18:42:45 UTC, Erik Smith wrote:
auto db = createDatabase("file:///testdb");
auto rowSet = db.connection().statement("select name,score
from score").execute;
foreach (r; rowSet)
writeln(r[0].as!stri
On Friday, 4 March 2016 at 16:43:00 UTC, Kagamin wrote:
On Friday, 4 March 2016 at 14:44:48 UTC, Erik Smith wrote:
Actually I like this and I think it can work. I'm trying to
keep a single execute function name for both row/no-row
queries. I can still return the range proxy for no-row queries
On Friday, 4 March 2016 at 11:57:49 UTC, Kagamin wrote:
On Thursday, 3 March 2016 at 18:08:26 UTC, Erik Smith wrote:
db.execute("select from t").reader; //row range
db.execute("select from t").get!long; //scalar
db.execute("select from t"); //non-query
More good options (the 3rd one is there).
On Thursday, 3 March 2016 at 20:31:47 UTC, Meta wrote:
On Thursday, 3 March 2016 at 20:16:55 UTC, Erik Smith wrote:
The later works and qualifying the allocator member variable
shared seems to solve the issue. Example:
struct A(T) {
alias Allocator = T;
shared Allocator allocator;
On Thursday, 3 March 2016 at 19:32:40 UTC, Brian Schott wrote:
On Thursday, 3 March 2016 at 19:01:52 UTC, Erik Smith wrote:
I get the error "allocate is not callable using a non-shared
object" and I'm not sure how to resolve it.
Are you calling `Mallocator.allocate()` or
`Mallocator.instance.
Just a question on Mallocator and shared. My code does a lot of
non-GC heap allocation (malloc) for buffers, so I reached for
Mallocator as a starting point. I propagate an Allocator type
generically through my structs, but it is defaulted to Mallocator.
After checking with the docs & TDPL, I
On Thursday, 3 March 2016 at 17:03:58 UTC, Kagamin wrote:
On Thursday, 3 March 2016 at 15:53:28 UTC, Erik Smith wrote:
auto r = db.connection().statement("select from t").range();
// nouns
db.execute("select from t").range();
`range` is probably ok.
Or
auto connection = db.createConnection();
On Thursday, 3 March 2016 at 16:08:03 UTC, Piotrek wrote:
I agree with you we need database manipulation in Phobos.
However modules like db, gui, xml or similar are too much work
for a one developer. And as you can see from time to time there
apears someone with its own vision.
That's why, lo
On Thursday, 3 March 2016 at 15:07:43 UTC, Kagamin wrote:
Also member names: methods are named after verbs, you use
nouns. Method `next` is ambiguous: is the first row the next
row? `fetch` or `fetchRow` would be better.
Those are actually internal methods not intended for the
interface user.
I suggest you call the package stdx.db - it is not (and may not
become) a standard package, so `std` is out of question. If it
is supposed to be *proposed* as standard package, then `stdx`
is good because that is what some people have used in the past
(while others used the ugly std.experimenta
1. In my opinion it should not be called std.database, but
let's say "std.dbc".
This is because it looks like a wrapper over db clients.
Moreover one may say it's almost impossible to make a common
and effective interface which would work with all databases.
e.g. someone on Wikipedia argues OD
I will look at your managed approach to understand it better.
One drawback I can think of is that destruction might not occur
immediately. This can be an issue for shared libraries when the
GC hasn't run when the library call returns to the host
application.
Maybe it's a C++ bias, but the R
Yes agree that the poly Database is broken - it isn't reference
counted and I will fix that.
Your sample code had me wondering if I am missing something else,
but I can't see another issue yet. I think the use of classes
would definitely lead to problems with resources being freed out
of ord
Hi Stefan,
It might be a challenge for CTFE compatibility in the API, but it
would be interesting to see how much of it is workable. There
does need to be some optional API elements in cases where it's
not supported by the underlying database client(array binding for
example) and these compi
Typo fixed - thanks. Incidentally, I'm not 100% content with
createDatabase. With the library being template based, the types
are no longer as easy to work with directly:
auto database = Database!DefaultPolicy();
alias cant be used because it instantiates. The template
argument can be defa
I'm back to actively working on a std.database specification &
implementation. It's still unstable, minimally tested, and there
is plenty of work to do, but I wanted to share an update on my
progress.
The main focus of this project is to bring a standard interface
for database clients.Th
I'm having a tough time finding a workaround for not being able
to reference adjacent types in a module
(https://issues.dlang.org/show_bug.cgi?id=15726). This is how I
want to do it, but can't:
module x.y.z;
struct A(T) {
alias B = .B!T;
}
struct B(T) {
alias A = .B!T;
alias C = .C!T
The struct->class workaround is unworkable in this case because
underlying C database clients are often pretty sensitive to out
of order resource cleanup and generate errors or crash as a
result. The structs are essential but I will limit the design to
avoid the issue for now.
Good to know that it's a bug - Thanks for the help. I've
created an issue to track this:
https://issues.dlang.org/show_bug.cgi?id=15726
I'm running OSX 10.11.2, DMD v2.070 installed via homebrew with
--devel flag.
erik
Here's a better reduction of the problem. Commenting out either
of the lines marked HERE eliminates the error. It's some kind
of interaction with templates, RefCounted, and the cross
referencing types.
erik
module database;
import std.typecons;
unittest {
auto con = Connection!int();
In the process of converting my working database interface to be
template based, I now get the following compiler error:
Error: struct
std.database.mock.database.Statement!int.Statement.Payload no
size yet for forward reference
I minimized the code to make it easier reason about. It seems t
My understanding is that using RefCounted is the recommended
approach for implementing value types involving shared resources
that require deterministic lifetimes. However, there has
historically been a race condition involving RefCounted
destruction and GC. Is there a solution for this?
T
I've started exploring the use of std.experimental.logger for my
std.database work. Presumably it would get in before
std.database.
What does "finalize reference counting" mean? (discussion
thread?) Is it about RefCounted? I'm using that extensively.
erik
I’m actively working on the low level interface and I’m making
good progress. My goal is to have a high quality interface
definition with working reference drivers for top tier databases.
The current references drivers are ODBC, sqlite, mysql, and
Oracle.
I think it’s important to suppor
It shouldn't. It should just make it so that the struct it's in
has a @disabled init value as well - which is annoying in its
own right, but it's not as restrictive. Regardless, if you want
to guarantee that a struct is constructed rather than having
its init value used, you have no choice. Ass
If you want to force that a constructor be called rather than
using the init value, then you need to make the init value
unusable by @disabling this(). Then the caller _has_ to
explicitly call a constructor or factory function. Regardless,
if you want a constructor that takes no arguments for a
I have a struct that uses RefCounted internally to manage a
database environment.It’s basically in the same boat as
RefCounted itself in that it requires runtime construction. Two
things set it apart:
1) No-arg construction is required
2) The potential prevalence of this type in applicati
It seems std.database.sql not std.database. You can't build,
for example, a mongodb driver over this.
Maybe, but mongodb is a proprietary nosql interface rather than a
standard one so I'm not sure that it should be in std.
erik
Maybe make the database providers interfaces instead of
data+dispatch? You're allocating the stuff anyway.
Do you mean inheriting from interfaces like this?
class MysqlStatement : Statement {...}
I need deterministic resource management and I don't think
classes provide that. Using structs w
Table a, b, c;
con.insert!Table(a);
...
if you use CTFE to create the statement string there is no
reason to reuse it.
it will be string literal, that's even better! Think Big. Think
D
the other code is Java not D
The statement reuse with binding is primarily for performance and
is import
Shouldn't the statement be reusable?
Yes it should. I added this use case:
auto stmt = con.statement("insert into table values(?,?)");
stmt.execute("a",1);
stmt.execute("b",2);
stmt.execute("c",3);
Since one obvious use case would be running the behind a http
server - vibe.d - using fibers a
On Thursday, 28 May 2015 at 03:40:36 UTC, Robert burner Schadek
wrote:
I believe you're a aiming to low.
If you have a struct you could use traits and ctfe to generate
perfect sql statements. This would make it possible to a range
of "struct Customers".
That would be awesome
I agree that i
I'm working on a standards grade interface & implementation for
database clients in D. It defines a common interface (the
implicit kind) and allows for both native and polymorphic
drivers. A key feature is a range interface to query results.
Here's the project page with the design highlights
44 matches
Mail list logo