首页 > 数据库 >vnext+sqlite3+sqlcipher

vnext+sqlite3+sqlcipher

时间:2022-08-16 15:13:26浏览次数:62  
标签:vnext Source Default de db sqlcipher sqlite3 Data

1.在abp.io网站上创建项目并选择数据库为sqlite。

2.默认情况下,sqlite是不加密的。

3.打开appsettings.json

"ConnectionStrings": {
    "Default": "Data Source=de.db;//You need to change to an absolute filename" 
  },

要改成

 "ConnectionStrings": {
    "Default": "Data Source=de.db;" 
  },

现在数据库是在运行目录下,如果要指定目录可以用绝对目录。

4.增加加密

 "ConnectionStrings": {
    "Default": "Data Source=de.db;password=123456;" 
  },

在配置文件中直接加上password会报错:You specified a password in the connection string, but the native SQLite library 'e_sqlite3' doesn't support encryption.”

在xxx.EntityFrameworkCore项目中加nuget :SQLitePCLRaw.bundle_e_sqlcipher ,

如果已经存在db文件,先删除后运行,不然报错。

标签:vnext,Source,Default,de,db,sqlcipher,sqlite3,Data
From: https://www.cnblogs.com/lecone/p/16591618.html

相关文章