A sample application written in .Net Core (3.1) which uses ADO.NET and the Repository pattern to access a SQLite3 database
- SQLite3 has only three data types (Text, Integer, and Real)
- Dates are represented as Integer days since November 24, 4714 BC (UTC)
- DateTimes are represented as Integer seconds since 1970-01-01 00:00:00 UTC
- Boolean is represented as Integer (0 = false; 1 = true)
- SQLite3 doesn't really support async. Which is fine, since it's not really for client/server and multi-user access. However, you can run it with WAL (see below)
- SQLite3 has a command-line shell program(sqlite3.exe), which provies bcp/sqlcmd type functionality
- SQLite3 supports In-memory databases
- XUnit is used as the testing framework
- INSERT should be followed by SELECT last_insert_rowid() for tables with IDENTITY as their Primary Key
- Returning Pages of data is accomplished via the LIMIT and OFFSET keywords: SELECT Id FROM [table] LIMIT 10 OFFSET 0;
- SQLite3 does NOT support Stored Procedures
- You store them as REAL and convert them to DateTime when you read them
- You don't need to set ModifiedDt or CreateDt in the POCO. These are set in the repository during Update and Add
- Update: UPDATE [table] SET ModifiedDt=strftime('%s','now');
- Add: INSERT INTO [table] (ModifiedDt,CreateDt) VALUES(strftime('%s','now'),strftime('%s','now'));