Drop column from SQLite table

Update: SQLite 2021-03-12 (3.35.0) now supports DROP COLUMN. From: http://www.sqlite.org/faq.html: (11) How do I add or delete columns from an existing table in SQLite. SQLite has limited ALTER TABLE support that you can use to add a column to the end of a table or to change the name of a table. If you want … Read more

UPSERT *not* INSERT or REPLACE

Assuming three columns in the table: ID, NAME, ROLE BAD: This will insert or replace all columns with new values for ID=1: INSERT OR REPLACE INTO Employee (id, name, role) VALUES (1, ‘John Foo’, ‘CEO’); BAD: This will insert or replace 2 of the columns… the NAME column will be set to NULL or the … Read more

Django: sudden DB reset after Heroku sleep

Heroku dynos have an ephemeral filesystem (https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem). Since you are using SQLite which is actually a file on the filesystem, everything will run smoothly until the dyno running your application needs to restart – so its filesystem will be reset and you’ll lose everything ! To avoid it just configure your application to use Heroku-Postgresql.

Integration Testing Entity Framework code first with in-memory database

Use SQL Compact 4.0 (download both SqlCE and tools by web platform installer) – EF Code first has direct support for that. The only difference will be that your application will use connection string to big SQL Server: <add name=”MyDbContext” provider=”System.Data.SqlClient” connectionString= “Data Source=…;InitialCatalog=…;Integrated Security=SSPI” /> and your tests will use connection string to SQL … Read more

SQLite database supporting Unicode data

SQLite always stores text data as Unicode, using the Unicode encoding specified when the database was created. The database driver itself takes care to return the data as the Unicode string in the encoding used by your language/platform. If you have conversion problems, either your application tried to store an ASCII string without converting it … Read more

How to build the Qt-SQL-driver-plugin ‘QSQLCIPHER’ for SQLite-DB with SQLCipher-extension using the Windows/MinGW-platform?

How to build the Qt-SQL-driver-plugin ‘QSQLCIPHER’ for SQLite-DB with SQLCipher-extension using the Windows/MinGW-platform: Qt 5.4.0 for Windows/MinGW Download Qt Install including the sources e.g to C:\Qt\Qt5.4.0 OpenSSL for Windows Download Win32 OpenSSL v1.0.2a Download Visual C++ 2008 Redistributable Install Visual C++ 2008 Redistributable by executing ‘vcredist_x86.exe’ Install OpenSSL v1.0.2a by executing ‘Win32OpenSSL-1_0_2.exe’ Target directory e.g. … Read more