It's not quite a data link.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore Initial commit Apr 18, 2016
ADODB_TLB.pas draft Apr 18, 2016
ADOTools.pas tweaks Apr 24, 2017
ADOX_TLB.pas ADO tweak Mar 23, 2017
Cassandra.pas first POC Cassandra.pas Mar 20, 2018
DataLank.pas tweaks Apr 24, 2017
DataLankProtocol.pas tweaks Apr 24, 2017
LICENSE Initial commit Apr 18, 2016
LibMy.pas LibMy.pas Sep 15, 2016
LibMyAsync.pas LibMy.pas Sep 15, 2016
LibPQ.pas Insert PKFieldName May 26, 2016
LibPQData.pas LibPQ: support interval Aug 30, 2018
LibPQData_HowTo_RefCursor.md rename Perform to Execute May 13, 2016
MDACVer_TLB.pas ADO tweak Mar 23, 2017
MSDATASRC_TLB.pas ADO tweak Mar 23, 2017
MyData.pas tweaks Apr 24, 2017
README.md LibPQ Apr 21, 2016

README.md

DataLank

What is it?

DataLank is the lightest possible abstract layer to access data. It is so light it is not complete. It is not ORM. It is not an be-all-end-all solution. It is not a data link. It provides a singular way to fetch and forward-only iterate single simple query result sets. Want more? Look elsewhere. The point of using a few objects with a pre-described interface is to avoid some of the work of switching to a different database somewhere down along the lifetime of a project, but not all.

How does it work?

DataLankProtocol.pas defines the interface for the TDataConnection and TQueryResult and objects, but you're not supposed to use it. (Except perhaps to include it in a project to see wether it compiles without syntax errors.)

In your project, include a DataLank.pas unit that just contains code like this, patching the objects through to the implementation of your choosing:

unit DataLink;

interface

uses SomeDBData;

type
  TDataConnection = TSomeDBConnection;
  TQueryResult = TSomeDBCommand;

implementation

end.

This enables you to use TDataConnection in the initialization code and TQueryResult throughout the application, and still change to a different database solition at a later point in the project's lifetime.

Implementations

Why 'Data Lank'

It's not quite a data link. The point is to have a data-layer that is as thin as possible, so I selected something from m-w: thesaurus/thin and as noted by m-w: dictionary/lank 'lank' stands for:

  • not well filled out: not every operation on the database is available in the limited abstraction. Normal operation can use the TQueryResult object, but advanced work like iterating over the results in a different manner or initiating an automated backup had to be done by talking to the specific database interface or other tools.

  • insufficient in quality, degree or extent: it is not suitable to everyone or for any project. Select to use DataLank in projects that will primarily use data from the database in a straight-forward manner, and can divert to other means to perform any advanced work on the data.

  • hanging straight and limp without spring or curl: it just lets you get and use data from the database using TQueryResult, nothing much more. It doesn't do any extra work for you. It's not ORM. It's only a clean simple imperfect abstraction layer to deminish the work needed to switch to a different database at a later point in the project's lifetime, but specifically not to eleminate that effort.

Examples of things made with DataLank