KDb/Drivers/Loopback

From KDE Community Wiki
< KDb‎ | Drivers
Revision as of 20:51, 6 April 2023 by Jstaniek (talk | contribs)

Design document

started: may 2005 by jstaniek
status: idea and some design, volunteers needed

The Loopback driver is a higher-level driver that performs introspection into plugged-in data sources and returns available information in a form of db views.

Example

Most important db views can look like the Schema Table of SQLite https://sqlite.org/schematab.html

CREATE TABLE sqlite_schema(
 type text,
 name text,
 tbl_name text,
 rootpage integer,
 sql text
);

Then, you can perform SELECT queries on the table.

Why?

This feature gives the overview of database objects and fields, eg. for creating a design report without a need for custom coding. As a consequence, e.g. KEXI can display data from this table as from any other tables, if this KDb driver is accessible.

We also get alternative way for schema introspection: by running a query, like:

SELECT * FROM TABLES WHERE name="foobar"

instead of using the KDb API (pseudocode):

KDbConnection::tableSchema("foobar")