Boost.Sql

Introduction

Primary Boost.Sql wants to solve this problem space:

  • give C++ an access to SQL-Databases, that is
    • easy to use
    • save
    • efficient
  • simplify two typical SQL usage patterns
    • full dynamic access
    • full typesave access like embedded SQL, but without a preprocessor

Secondary, we want to contribute to the discussion for a possible 'C++' standard in this domain.

Organisation

Foundation: boost::sql::odbc

Boost.Sql is at its lowest level a C++ adoption of ODBC.

It defines the basic interface as 'concepts', where the semantic is specified as a reference implementation with ODBC.

This modul resides int the boost::sql::handles namespace.

Why ODBC?

  • The ODBC mechanism is a well known an widely used technology.
  • There are implementations nearly everywhere.
  • We can build on top of existing offical ISO/X-open and defacto ODBC standards.
  • We can build on top of existing software.

You can assume nothing?: boost::sql::dynamic

You have to access a datasource, which's structure is totaly unknown at the the time you write your programm?

This is the library to simplify your life.

An typical application of this modul is an interactive SQL programm, witch is shown as an example.

You know (and maybe control) all?: boost::sql::embedded

  • You know the tables to work with?
  • You desgin the tables and are responsible
    • that they exist in any arbitrary database?
    • that the database reflect the changes you make from releas to release?

This libray helps to automate this tasks, by simulating SQL as an 'embedded domain specific language'.

So already the C++ compiler check the syntacticaly correctness of your SQL statements.

The design tries to give you the comfort of

  • 'embedded SQL' without an preprocessor, and
  • Linq with zero runtime costs.

To do this, you have to declare the datebase layout in the C++ code.

There is an utility to generate the table definitions out from an existing database. So you can automately enshure that the program has always the right view of the tables.

There is also a much more interesting feature, with will force the databases table to the layout you specify in the program.

Keine Kategorien vergebenBearbeiten

Diskussionen