Features of the SQLite database
Characteristics:
1. Lightweight
2. Independence, no reliance, no installation
3. Isolation all in one folder system
4. Cross-platform support for many operating systems
5. Multi-lingual interface supports many programming languages
6. Security things, through exclusive and shared locks for the processing of independent transactions, multiple processes can read data from the same database at the same time, but only one can write data
Supported Data types:
Support for NULL,INTEGER,REAL,TEXT,BLOB data types
Represents, null, integer, floating-point value, String type, binary object,
Dynamic type reference (weak reference)
When a value is inserted into the database, SQLite will check his type, and if the type does not match the associated column, SQLite will attempt to convert the transformation to the type of the column, and if it cannot, the value will be stored as its own type.
Instructions for use:
There is no network server available for SQLite, there may be file locking or performance issues that can only be shared over a network share.
There is no concept of user accounts, but is based on the sharing settings of the file system.
Supports database size up to 2TB.
The visual tools of SQLite
: Https://sqlitestudio.pl/index.rvt?act=download
Operations under Windows
Download
After extracting, run EXE file
Create a new database file
Link Database files
After setting the path and name, click on the link test.
Then click OK to finish!
SQLite Rookie Tutorial Link: http://www.runoob.com/sqlite/sqlite-tutorial.html
SQLite does not support drop column, so deleting a column or a general SQL statement is still a bit different, the following dapper for SQLite
<connectionStrings>
<add name="SQLiteCon" connectionString="Data Source=D:\DBFile\SQLite\Test.db;Version=3" providerName="System.Data.SQLite" />
</connectionStrings>
public void SQLiteMethod ()
{
using (DbBase db = CreateDB.CreateDbBase ())
{
// New column
int a = db.Execute (@ "ALTER TABLE Student ADD‘ SEX ‘varchar");
// Delete column
// 1. First create a new table Student2 based on the Student table
// 2. Then we delete the Student table
// 3. Rename the Student2 table to Student
var tran = db.DbTransaction;
int b1 = db.Execute (@ "CREATE TABLE Student2 as select ID, NAME, ADDRESS FROM Student", tran);
int b2 = db.Execute (@ "DROP TABLE if exists Student", tran);
int b3 = db.Execute (@ "ALTER TABLE Student2 rename to Student", tran);
if (b1 == 0 && b2 == 0 && b3 == 0)
{
tran.Commit ();
}
else
{
tran.Rollback ();
}
//increase
int index = db.Execute (@ "INSERT INTO Student (ID, NAME, ADDRESS)
VALUES (1, ‘Li Si’, ‘Oriental Pearl’) ");
//delete
int index2 = db.Execute (@ "DELETE FROM Student WHERE ID = 1");
//change
var updateSql = "UPDATE Student SET NAME =‘ li bai ’WHERE [email protected]”;
bool res = db.Update <Student> (updateSql, new {ID = 1});
//check
string selectSql = @ "SELECT * FROM Student";
var student = db.Query <Student> (selectSql);
// Bulk Insert
bool resBatch = db.InsertBatch <Student> (student);
}
}
Visualization Tools SQLite Studio