視覺化檢視SQLite studio

來源:互聯網
上載者:User

標籤:https   batch   dap   update   text   解壓   var   esb   多個   

 SQLite資料庫的特性

特點:

1.輕量級
2.獨立性,沒有依賴,無需安裝
3.隔離性 全部在一個檔案夾系統
4.跨平台 支援眾多作業系統
5.多語言介面 支援眾多程式設計語言
6.安全性 事物,通過獨佔性和共用鎖定來實現獨立事務的處理,多個進程可以在同一個時間內從同一個資料庫讀取資料,但只有一個可以寫入資料
所支援的資料類型:

支援NULL,INTEGER,Real,text,blob資料類型
一次代表,空值,整型值,浮點值,字串類型,二進位對象,
動態類型引用(弱引用)
當某個值插入到資料庫是,SQlite將會檢查他的類型,如果該類型與關聯的列不匹配,SQlite則會嘗試將改制轉換成該列的類型,如果不能轉換,則該值將作為本身的類型儲存

使用須知:
沒有可用於SQlite的網路伺服器,只能通過網際網路共用可能存在檔案鎖定或者效能問題。
沒有使用者賬戶的概念,而是根據檔案系統的共用設定。
支援資料庫大小至2TB。

 

 SQLite的視覺化檢視

:https://sqlitestudio.pl/index.rvt?act=download

 

 Windows下操作

下載

 

解壓後,運行exe檔案

 

建立個資料庫檔案

連結資料庫檔案

 

路徑和名稱設定好後,點選連結測試

 

 

然後點擊OK 就完成了!

 

 SQLite菜鳥教程連結:http://www.runoob.com/sqlite/sqlite-tutorial.html

 

SQLite不支援drop column,所以刪除一列還是和一般sql語句還是有點區別的,下面Dapper對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())            {                //新增列                int a = db.Execute(@"ALTER TABLE Student ADD ‘SEX‘ varchar");                //刪除列                 //1.首先根據Student表建立一張新表Student2                //2.然後我們刪除Student這個表                //3.將Student2這個表重新命名為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();                }                //增                int index = db.Execute(@"INSERT INTO Student(ID,NAME,ADDRESS)                                         VALUES(1, ‘李四‘, ‘東方明珠‘) ");                //刪                int index2 = db.Execute(@"DELETE FROM Student WHERE ID = 1 ");                //改                var updateSql = "UPDATE Student SET NAME=‘李白‘ WHERE [email protected]";                bool res = db.Update<Student>(updateSql, new { ID = 1 });                //查                string selectSql = @"SELECT * FROM Student ";                var student = db.Query<Student>(selectSql);                //批量插入                bool resBatch = db.InsertBatch<Student>(student);            }        }

 

視覺化檢視SQLite studio

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.