const quince_postgresql::database db("localhost", "postgres", "postgres", "quincetest", "test");
const quince_sqlite::database db("quincetest");
Either of the above definitions creates an object to represent the SQL database we are about to populate and query.
doesn't create the SQL database. That is something you have to do outside
of quince, e.g. by using the PgAdminIII GUI tool (for PostgreSQL) or the
sqlite3.exe commandline tool (for sqlite). It may require special privileges.
doesn't connect to the SQL database either. All it does is remember the
parameters for later, when quince makes connections. (This happens automatically
localhostis the hostname of the machine running the DBMS.
postgresare, in order, the user name and password to give the server.
quincetestis the name of the database that we'll be connecting to.
testis the name of the default schema we'll be using. For the purposes of this chapter, that's the schema where all our tables will be created.
quincetestis the name of the database to use, which for sqlite is the name of the database file.
All the string arguments to either database constructor are interpreted as UTF-8.
Now that we have a database object, the rest of our program will not mention PostgreSQL or sqlite. All our API calls will be to quince itself, not to the backend libraries.