mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 支持 Sqlite :memory: 模式; #191
This commit is contained in:
@ -3,6 +3,7 @@ using FreeSql.Internal.Model;
|
||||
using SafeObjectPool;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Data.SQLite;
|
||||
using System.Text;
|
||||
@ -18,9 +19,9 @@ namespace FreeSql.Sqlite
|
||||
base._util = util;
|
||||
if (connectionFactory != null)
|
||||
{
|
||||
MasterPool = new FreeSql.Internal.CommonProvider.DbConnectionPool(DataType.Sqlite, connectionFactory);
|
||||
_CreateCommandConnection = MasterPool.Get().Value;
|
||||
_CreateCommandConnection.Close();
|
||||
var pool = new FreeSql.Internal.CommonProvider.DbConnectionPool(DataType.Sqlite, connectionFactory);
|
||||
MasterPool = pool;
|
||||
_CreateCommandConnection = pool.TestConnection;
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(masterConnectionString))
|
||||
|
@ -106,6 +106,12 @@ namespace FreeSql.Sqlite
|
||||
_connectionString = string.Concat(att[0], idx == -1 ? "" : att[1].Substring(idx));
|
||||
}
|
||||
|
||||
if (_connectionString.ToLower().Contains(":memory:"))
|
||||
{
|
||||
//内存模式
|
||||
PoolSize = 1;
|
||||
}
|
||||
|
||||
#if ns20
|
||||
minPoolSize = 1;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user