Overview

toyworks

This toyworks project is just some early experimentation with SQL in C and C++. It should not by any stretch of the imagination be considered production ready code. If you, the reader, are someone who has stumbled across this code on the Internet looking for some C or C++ code that interacts with some database or other, you should look elsewhere. This code is poorly designed -- non-modular, security-unconscious, full of unwarranted assumptions, lacking any kind of sanity checks, and probably unpleasant in some other ways besides. On the plus side, it probably won't mug your grandmother or kill your dog.

subprojects note

I decided to rearrange the toyworks project so that the MySQL++ related code got shuffled off to its own subdirectory (mysqlpp/ to be exact), and other parallel subprojects of toyworks could be stuck in their own subdirectories as well. The MySQL++ subproject basically hasn't been touched since I first put it together, apart from being moved; I'm just using it as a pattern now for playing with other database access libraries to learn very basic syntax for each of them.

mysqlpp

The mysqlpp subproject makes use of the MySQL++ library.

Dependencies

The mysqlpp subproject depends on the MySQL++ library and everything on which it depends. It uses the MySQL DBMS.

Behavior

The mysqlpp toyworks program's behavior involves cleaning up anything that was added on a previous run, adding a couple of records to the table, then altering one record. After each of these operations, it prints information about the contents of the table to stdout.

Output of the program should look something like this:

####### First Output Run #######

Title: AerieBSD
Category: software

Title: AHWM
Category: software

####### Second Output Run #######

Title: AerieBSD
Category: software

Title: AHWM
Category: software

Title: AntiWM
Category: software

Title: Code Reuse and Technological Advancement
Category: software

####### Third Output Run #######

Title: AerieBSD
Category: software

Title: AHWM
Category: software

Title: AntiWM
Category: software

Title: Code Reuse and Technological Advancement
Category: essay

Starting State

The assumed starting state for the database touched by this code, as reported by the mysql console based client, is as follows:

mysql> select * from works;
+----+------------------------------------------+----------+
| id | title                                    | category |
+----+------------------------------------------+----------+
|  1 | AerieBSD                                 | software |
|  2 | AHWM                                     | software |
|  3 | AntiWM                                   | software |
|  4 | Code Reuse and Technological Advancement | essay    |
+----+------------------------------------------+----------+
4 rows in set (0.00 sec)

pq

Dependencies

The pq subproject depends on the libpq library and everything on which it depends. It uses the PostgreSQL DBMS.

Behavior and Starting State

At present, the pq toyworks program exhibits the exact same observable behavior as the mysqlpp toyworks program, with the same assumed starting state (though the output in the psql console based client looks a little different, cosmetically).

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.