SQLite Connection Strings

Source: Internet
Author: User
Tags connection pooling memory usage sqlite database utf 8 connectionstrings


          • BasicData Source=c:\mydb.db;Version=3;

    Version 2 is not a supported by the This class library.

    Sqlite
    • In-memory Database

      An SQLite database was normally stored on disk, but the database can also was stored in memory. Read more about the SQLite in-memory databases here.

      Data Source=:memory:;Version=3;New=True;
      Sqlite
    • Using UTF16Data Source=c:\mydb.db;Version=3;UseUTF16Encoding=True;
      Sqlite
    • with passwordData Source=c:\mydb.db;Version=3;Password=myPassword;
      Sqlite
    • Using the pre 3.3x database formatData Source=c:\mydb.db;Version=3;Legacy Format=True;
      Sqlite
    • With connection pooling

      Connection pooling is isn't enabled by default. Use the following parameters to control the connection pooling mechanism.

      Data Source=c:\mydb.db;Version=3;Pooling=True;Max Pool Size=100;
      Sqlite
    • Read only ConnectionData Source=c:\mydb.db;Version=3;Read Only=True;
      Sqlite
    • Using datetime.ticks as DateTime formatdata source=c:\mydb.db;version=3; Datetimeformat=ticks;

      The default value is ISO8601 which activates the use of the ISO8601 datetime format

      sqlite
    • Store GUID as Text

      Normally, GUIDs is stored in a binary format. Use the This connection string to store GUIDs as text.

      Data Source=c:\mydb.db;Version=3;BinaryGUID=False;

      Note that storing GUIDs as text uses more space in the database.

      Sqlite
    • Specify Cache SizeData Source=c:\mydb.db;Version=3;Cache Size=2000;

      The Cache Size value measured in bytes

      Sqlite
    • Specify page sizeData Source=c:\mydb.db;Version=3;Page Size=1024;

      The Page Size value measured in bytes

      Sqlite
    • Disable Enlistment in distributed transactionsData Source=c:\mydb.db;Version=3;Enlist=N;
      Sqlite
    • Disable Create Database behaviour

      If The database file doesn ' t exist, the default behaviour is to create a new file. Use the following parameter to raise an error instead of creating a new database file.

      data source=c:\mydb.db; Version=3; Failifmissing=true;
        sqlite
    • Limit the size of the databaseData Source=c:\mydb.db;Version=3;Max Page Count=5000;

      The Max Page Count is measured in pages. This parameter limits the maximum number of pages of the database.

      Sqlite
    • Disable the Journal File

      This one disables the rollback journal entirely.

      Data Source=c:\mydb.db;Version=3;Journal Mode=Off;
      Sqlite
    • Persist The Journal file

      This one blanks and leaves the Journal file on disk after a commit. Default behaviour is to delete the Journal File after each commit.

      data source=c:\mydb.db; Version=3; Journal mode=persist;
        sqlite
    • controling file FlushingData Source=c:\mydb.db;Version=3;Synchronous=Full;

      FULL specifies a full flush to take action after each write. Normal is the default value. Off means that the underlying OS flushes I/O ' s.

      Sqlite


    ?   problems connecting? Get answer in the SQLite Q & A forum→


  • Finisar.sqlite ADO Data Provider
    • StandardData Source=c:\mydb.db;Version=3;

      The "Version" key can take value ' 2 ' for SQLite 2.x (default) or value ' 3 ' for SQLite 3.x

      Sqlite
    • SQLite Version 2.XData Source=c:\mydb.db;Version=2;
      Sqlite
    • Create a new databaseData Source=c:\mydb.db;Version=3;New=True;
      Sqlite
    • Using compressionData Source=c:\mydb.db;Version=3;Compress=True;
      Sqlite
    • Specifying Cache Size

      The Cache Size value represents the amount of data pages that is held in memory. Try increase this value is improvements but don ' t forget-keep track of the applications memory usage.

      Data Source=c:\mydb.db;Version=3;Cache Size=3000;
      Sqlite
    • UTF 8Data Source=c:\mydb.db;Version=3;UTF8Encoding=True;
      Sqlite
    • UTF 16Data Source=c:\mydb.db;Version=3;UTF16Encoding=True;


SQLite Connection Strings


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.