SQLite Download Page. The amalgamation source code, the command-line shell source code, configure/make scripts for unix, and a Makefile.msc for Windows. See the change log or the timeline for more information. C source code as an amalgamation, version 3.36.0. C source code as an amalgamation. Sqlite Viewer Free Courses › Most Popular Law Newest at www.easy-online-courses.com Courses. Posted: (1 week ago) Use Free Sqlite Reader to View Sqlite Database Files › Discover The Best Online Courses www.sqliteviewer.com Courses.Posted: (3 days ago) Sqlite is the frontend database manager, deployed in various OS, applications and Browsers such as.
The Mono.Data.SqliteClient assembly contains an ADO.NET data provider for the SQLite embeddable database engine (both version 2 and version 3).
SQLite has a notable oddity: table cell data does not retain what kind of data it was. Everything is stored as either a long, double, string, or blob. And in SQLite version 2, everything is stored as a string. So you need to be careful about avoiding casting values returned by SQLite without checking the type of the value returned. See below for notes on storing DateTimes.
Table of contents |
New style assembly shipped with Mono 1.2.4
Starting with the 1.2.4 release, Mono ships a second SQLite assembly - Mono.Data.Sqlite. The new assembly provides support only for SQLite version 3and is not 100% binary and API compatible with the older assembly. The new assembly is based on code by Robert Simpson from http://sqlite.phxsoftware.com/ and provides full ADO.NET 2.0 API interface. Code from the old binary is contained in the new one but is available only in the 1.1 profile. The 2.0 profile can no longer access the old code when referencing the new assembly. We have chosen this way as means to provide a migration path for developers using SQLite in their .NET applications - both assemblies will be shipped with several future releases of Mono, and at some (yet undetermined) point the old one will be removed from the distribution. All the developers are encouraged to start transitioning their code to the new assembly - for both 1.1 and 2.0 profiles.
One disadvantage of the new assembly is its binary incompatibility in the data format. That is, if your application uses SQLite database v2 format you will not be able to access your data with the new assembly. To solve this problem you must dump your data using sqlite v2 utilities and then restore it using sqlite v3 utilities.
Prerequisites
If you do not have SQLite, download it. There are binaries for Windows and Linux. You can put the .dll or .so along side your application binaries, or in a system-wide library path.
Connection String Format
The format of the connection string is:
The latter case for the 2.0 profile references the App_Data directory (or any other directory that’s configured to contain data files for an ASP.NET 2.0 application)
As an example:
That will use the database SqliteTest.db in the current directory. It will be created if it does not exist.
Or you prefer to use SQLite as an in memory database
The version=3
is supported, but not necessary with the new assembly.
With the old assembly, the ADO.NET adapter will use SQLite version 2 by default, but if version 2 is not found and version 3 is available, it will fallback to version 3. You can force the adapter to use version 3 by adding “version=3” to the connection string:
The new assembly, as described above, uses only database format version 3.
- Connection String Parameters:
For the 1.1 profile and the old assembly
Parameter Definition | Description | Example |
---|---|---|
URI | a file Universal Resource Identifier | URI=file:SqliteTest.db |
version | version of SQL Lite to use: version 2 or 3 | version=3 |
busy_timeout | a timeout, in milliseconds, to wait when the database is locked before throwing a SqliteBusyException (since Mono 1.1.14) | busy_timeout=3000 |
The busy_timeout parameter is implemented as a call to sqlite(3)_busy_timeout. The default value is 0, which means to throw a SqliteBusyException immediately if the database is locked.
For the 2.0 profile in the new assembly
Db Reader For Sqlite
Parameter Definition | Description | Example |
---|---|---|
Data Source | a file Universal Resource Identifier | Data Source=file:SqliteTest.db |
version | version of SQL Lite to use: version 3 | version=3 |
Storing DateTimes
Sqlite Database Browser
The way DateTimes are stored and retrieved from Sqlite databases depends on a lot, unfortunately, because Sqlite doesn’t have a way of storing datetimes natively. Further, there are two versions of Sqlite (2 and 3) which are treated differently when it comes to DateTimes. The recommended way of using DateTimes with Sqlite is to encode/decode them yourself to/from some particular integer string format that you decide, and not putting them into a DATE or DATETIME column.
Sqlite2 only has strings internally. No matter what the column was declared as, DateTimes are just going to be converted into strings. If you use parameters, for instance, DateTimes will be converted in a culture-sensitive format. When reading back the data, there’s no way to know that it was originally a DateTime and not a string, so Mono.Data.SqliteClient returns the string. Using Sqlite2, you really can’t use DateTimes without encoding them yourself.
If you explicitly are targetting Sqlite3, or using the new assembly (in which case you should be providing the version parameter in the connection string, unless you are using the new assembly), you can rely on the particular behavior used when connecting to a Sqlite3 database. Sqlite3 has string, integer (64bit), real, and blob internal storage types. When putting a DateTime into the database using parameters, Mono.Data.SqliteClient will encode the DateTime as an integer using ToFileTime(). But this doesn’t help when reading the data back to determine that a value was originally a DateTime. Sqlite3 also exposes the names of the types of the columns as the table was created with. If a column is declared as a DATE or DATETIME, SqliteDataReader will try to turn the value back into a DateTime. If it finds an integer value, it uses DateTime.FromFileTime, which is the reverse of how it encodes DateTimes if you insert a DateTime via parameters. If it finds a string value, it uses DateTime.Parse, but note that Parse is a very slow operation. So with Sqlite3, DateTimes should be put into DATE or DATETIME columns in the database either through parameters or by turning it into a long with ToFileTime yourself, and then they will be read back as DateTimes.
Character Encodings
The Sqlite client treats character encodings differently for version 2 and version 3 because of the way Sqlite2 and 3 treat strings.
In Sqlite3, the Sqlite client communicates with Sqlite in Unicode. Therefore, you should be able to read and write any characters from the database, but note that if you write Unicode characters to a database, you may not be able to read them back in other applications if the application does not communicate with Sqlite using Unicode.
In Sqlite2, the client by default communicates with Sqlite using the UTF-8 encoding, which means you can read and write any character. But you must beware of two things. The first is that since non-ASCII characters are encoded as multi-byte characters in UTF-8, and Sqlite2 doesn’t recognize multibyte characters (unless it was compiled specifically with UTF-8 support), LIKE, GLOB, LENGTH, and SUBSTR will behave oddly. The second caveat is that other applications using the database must be using UTF-8 as well.
When using Sqlite2, you can force Mono.Data.SqliteClient to use a different encoding instead of UTF-8 by adding “;encoding=ASCII” for instance to the connection string. It must be an encoding that ends with a single null terminator, however.
C# Example (1.1 profile of the new assembly and the old assembly)
To build the example:
- Save the example to a file, such as, TestExample.cs
- Build using Mono C# compiler:
To run the example:
If you are looking for an SQLite Editor in the public domain under Creative Commons license or GPL (General Public License) i.e. for free commercial or non-commercial use. Then here is a shortlist of the SQLite Editor that is available on the web for free download.
These software work on macOS, Windows, Linux and most of the Unix Operating systems.
1. SQLiteStudio
Link : http://sqlitestudio.pl/
SQLiteStudio Database manager has the following features :
- A small single executable Binary file, so there is need to install or uninstall.
- Open source and free - Released under GPLv2 licence.
- Good UI with SQLite3 and SQLite2 features.
- Supports Windows 9x/2k/XP/2003/Vista/7, Linux, MacOS X, Solaris, FreeBSD and other Unix Systems.
- Language support : English, Polish, Spanish, German, Russian, Japanese, Italian, Dutch, Chinese,
- Exporting Options : SQL statements, CSV, HTML, XML, PDF, JSON, dBase
- Importing Options : CSV, dBase, custom text files, regular expressions
- UTF-8 support
2. Sqlite Expert
Link : http://www.sqliteexpert.com/download.html
SQLite Expert though not under public domain, but its free for commercial use and is available in two flavours.
a. Personal Edition
- It is free for personal and commercial use but, covers only basic SQLite features.
- But its a freeware and does not have an expiration date.
b. Professional Edition
- It is for $59 (onetime fee, with free lifetime updates )
- It covers In-depth SQLite features.
- But its a freeware and does not have an expiration date.
Features :
- Visual SQL Query Builder : with auto formatting, sql parsing, analysis and syntax highlighting features.
- Powerful restructure capabilities : Restructure any complex table without losing data.
- Import and Export data : CSV files, SQL script or SQLite. Export data to Excel via clipboard.
- Data editing : using powerful in-place editors
- Image editor : JPEG, PNG, BMP, GIF and ICO image formats.
- Full Unicode Support.
- Support for encrypted databases.
- Lua and Pascal scripting support.
3. Database Browser for SQLite
Link : http://sqlitebrowser.org/
- Database Browser for SQLite is a high quality, visual, open source tool to create, design, and edit database files compatible with SQLite.
- Database Browser for SQLite is bi-licensed under the Mozilla Public License Version 2, as well as the GNU General Public License Version 3 or later.
- You can modify or redistribute it under the conditions of these licenses.
Features :
- You can Create, define, modify and delete tables
- You can Create, define and delete indexes
- You can Browse, edit, add and delete records
- You can Search records
- You can Import and export records as
- You can Import and export tables from/to text, CSV, SQL dump files
- You can Issue SQL queries and inspect the results
- You can See Log of all SQL commands issued by the application
4. SQLite Manager for Firefox Browser
Link : https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/This is an addon plugin for Firefox Browser,
Features :
Sqlite Database Example
- Manage any SQLite database on your computer.
- An intuitive hierarchical tree showing database objects.
- Helpful dialogs to manage tables, indexes, views and triggers.
- You can browse and search the tables, as well as add, edit, delete and duplicate the records.
- Facility to execute any sql query.
- The views can be searched too.
- A dropdown menu helps with the SQL syntax thus making writing SQL easier.
- Easy access to common operations through menu, toolbars, buttons and context-menu.
- Export tables/views/database in csv/xml/sql format. Import from csv/xml/sql (both UTF-8 and UTF-16).
- Possible to execute multiple sql statements in Execute tab.
- You can save the queries.
- Support for ADS on Windows
Sqlite Firefox Plugin
- SwissCovid App Launched in Switzerland - News
- How to create Toast messages in Android? - Android
- Change Height of Android ActionBar - Android
- Word wrap text in Notepad++ - NotepadPlusPlus
- align image at middle of div element - CSS