Databases and the D Standard Library
Chris Wright via Digitalmars-d
digitalmars-d at puremagic.com
Sun Jan 1 08:53:40 PST 2017
On Sat, 31 Dec 2016 19:24:31 -0800, Adam Wilson wrote:
> My idea: Each data store has it's own implementation with it's own
> naming convention. For example (ADO.NET):
> - SqlConnection (MSSQL)
> - NpgsqlConnection (Npgsql)
>
> Yes, this means that you have to change names in your code if you switch
> data-stores
You *can* use classes and interfaces and type hierarchies. They do use
the GC by default, unlike structs, but they're kind of handy, especially
here.
Then you have a SqlConnection interface that most people use all the time
and all people use most of the time. If you explicitly need some
connection properties that are specific to Postgres, you cast to a
PostgresConnection.
More information about the Digitalmars-d
mailing list