Skip to content

Commit 657b9cc

Browse files
committed
(Modify): compatible SQLite.Attribute
1 parent 2247db1 commit 657b9cc

File tree

12 files changed

+50
-109
lines changed

12 files changed

+50
-109
lines changed

SqlCipher4Unity3D.unitypackage

3.94 KB
Binary file not shown.

SqlCipher4Unity3D/Assets/SqlCipher4Unity3D/SQLite.Attribute.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

SqlCipher4Unity3D/Assets/SqlCipher4Unity3D/SQLite.Attribute/SQLite.Attribute.dll.meta

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

SqlCipher4Unity3D/Assets/SqlCipher4Unity3D/SQLite.Attribute/SQLite.Attribute.pdb.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SqlCipher4Unity3D/Assets/SqlCipher4Unity3D/Sqlite3.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ public static partial class SQLite3 {
191191
[DllImport(DLL_NAME, EntryPoint = "sqlite3_config", CallingConvention=CallingConvention.Cdecl)]
192192
public static extern Result Config (ConfigOption option);
193193

194-
[DllImport(DLL_NAME, EntryPoint = "sqlite3_win32_set_directory", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Unicode)]
195-
public static extern int SetDirectory (uint directoryType, string directoryPath);
194+
//[DllImport(DLL_NAME, EntryPoint = "sqlite3_win32_set_directory", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Unicode)]
195+
//public static extern int SetDirectory (uint directoryType, string directoryPath);
196196

197197
[DllImport(DLL_NAME, EntryPoint = "sqlite3_busy_timeout", CallingConvention=CallingConvention.Cdecl)]
198198
public static extern Result BusyTimeout (IntPtr db, int milliseconds);

SqlCipher4Unity3D/Assets/SqlCipher4Unity3D/Sqlite3Attribute.cs

Lines changed: 0 additions & 91 deletions
This file was deleted.

SqlCipher4Unity3D/Assets/SqlCipher4Unity3D/Sqlite3Attribute.cs.meta

Lines changed: 0 additions & 12 deletions
This file was deleted.

SqlCipher4Unity3D/Assets/SqlCipher4Unity3D/Sqlite3Connection.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
using Sqlite3Statement = System.IntPtr;
2323
#endif
2424

25-
namespace SqlCipher4Unity3D {
25+
namespace SqlCipher4Unity3D
26+
{
27+
using SQLite.Attribute;
2628
/// <summary>
2729
/// Represents an open connection to a SQLite database.
2830
/// </summary>
@@ -60,7 +62,7 @@ public partial class SQLiteConnection : IDisposable {
6062
/// only here for backwards compatibility. There is a *significant* speed advantage, with no
6163
/// down sides, when setting storeDateTimeAsTicks = true.
6264
/// </param>
63-
public SQLiteConnection (string databasePath, string password, bool storeDateTimeAsTicks = false)
65+
public SQLiteConnection (string databasePath, string password = null, bool storeDateTimeAsTicks = false)
6466
: this (databasePath, password, SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create, storeDateTimeAsTicks)
6567
{
6668
}
@@ -104,7 +106,7 @@ public SQLiteConnection (string databasePath, string password, SQLiteOpenFlags o
104106
throw SQLiteException.New (r, String.Format ("Could not open database file: {0} ({1})", DatabasePath, r));
105107
}
106108

107-
if (password != null) {
109+
if (!string.IsNullOrEmpty(password)) {
108110
var result = SQLite3.Key(handle, password, password.Length);
109111
if (result != SQLite3.Result.OK) {
110112
throw SQLiteException.New (r, String.Format ("Could not open database file: {0} ({1})", DatabasePath, r));

0 commit comments

Comments
 (0)