Skip to content

Commit 890007a

Browse files
Update README.md
1 parent 9c64d9d commit 890007a

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
11
# SQLiteClassBuilder
22
A command line tool for creating type safe SQL classes. The tool uses the database schema to create a class for each table and view. It has many command line options to allow developers to customize the class creation.
3-
Each class is created in it's own header (*.h). A master header is created which includes all the headers.
3+
Each class is created in it's own header (*.h). A master header (sql_Master_Header.h) is created which includes all the headers.
4+
5+
## Usage Example:
6+
````
7+
SQLiteClassBuilder.exe "my_database.db"
8+
````
9+
10+
## SQLite3pp_EZ containers
11+
By default, classes are created so they're compatible with sqlite3pp::Table and sqlite3pp::TableOStream container classes.
12+
13+
See https://github.com/David-Maisonave/sqlite3pp_EZ
14+
15+
These container classes can be populated using a single line of code: ``Table<sql_table_FileExt> tbl(DbFileNameArg("mydatabase.db"));``
16+
17+
In this example, **sql_table_FileExt** is a class created by SQLiteClassBuilder, and "mydatabase.db" is the file name of the SQLite database.
18+
19+
Example#1
20+
````
21+
sqlite3pp::Table<sql_table_FileExt> tbl(DbFileNameArg("mydatabase.db"));
22+
for (auto row : my_tbl)
23+
std::wcout << row << std::endl;
24+
25+
````
26+
27+
28+
Example#2
29+
````
30+
sqlite3pp::TableOStream<sql_table_FileExt> tbl(DbFileNameArg("mydatabase.db"));
31+
std::cout << tbl; // Send data to screen with the changed delimiter
32+
33+
````
34+
35+
36+
Example#3
37+
````
38+
sqlite3pp::TableOStream<sql_table_FileExt> tbl(DbFileNameArg("mydatabase.db"));
39+
std::ofstream ofs ("data.csv", std::ofstream::out); // Open a file
40+
ofs << tbl; // Write data to the csv file
41+
42+
````
43+

0 commit comments

Comments
 (0)