chore: Assets 디렉토리 구조 정리 및 네이밍 컨벤션 적용
- Assets/_Game/ 하위로 게임 에셋 통합 - External/ 패키지 벤더별 분류 (Synty, Animations, UI) - 에셋 네이밍 컨벤션 확립 및 적용 (Data_Skill_, Data_SkillEffect_, Prefab_, Anim_, Model_, BT_ 등) - pre-commit hook으로 네이밍 컨벤션 자동 검사 추가 - RESTRUCTURE_CHECKLIST.md 작성 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "Gilzoide.SqliteNet",
|
||||
"rootNamespace": "SQLite",
|
||||
"references": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": true,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17f96cd3b93974f6493e51a2f25c1241
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SQLite
|
||||
{
|
||||
public static class SQLiteAsyncExtensions
|
||||
{
|
||||
#if UNITY_WEBGL
|
||||
// WebGL builds cannot use background threads, so use a
|
||||
// TaskScheduler that executes tasks on Unity's main thread.
|
||||
public static TaskScheduler TaskScheduler { get; private set; }
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
private static void InitializeTaskScheduler()
|
||||
{
|
||||
TaskScheduler = TaskScheduler.FromCurrentSynchronizationContext();
|
||||
}
|
||||
#else
|
||||
// On all other platforms, use the default TaskScheduler
|
||||
public static TaskScheduler TaskScheduler => TaskScheduler.Default;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da6b73f57890c4a9ca69e882cd03e45e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Gil Barbosa Reis
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
using Unity.Collections;
|
||||
using Unity.Collections.LowLevel.Unsafe;
|
||||
#endif
|
||||
|
||||
namespace SQLite
|
||||
{
|
||||
public static class SQLiteConnectionExtensions
|
||||
{
|
||||
public static byte[] Serialize(this SQLiteConnection db, string schema = null)
|
||||
{
|
||||
IntPtr buffer = SQLite3.Serialize(db.Handle, schema, out long size, SQLite3.SerializeFlags.None);
|
||||
if (buffer == IntPtr.Zero)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
var bytes = new byte[size];
|
||||
Marshal.Copy(buffer, bytes, 0, (int) size);
|
||||
return bytes;
|
||||
}
|
||||
finally
|
||||
{
|
||||
SQLite3.Free(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public static SQLiteConnection Deserialize(this SQLiteConnection db, byte[] buffer, string schema = null, SQLite3.DeserializeFlags flags = SQLite3.DeserializeFlags.None)
|
||||
{
|
||||
return Deserialize(db, buffer, buffer.LongLength, schema, flags);
|
||||
}
|
||||
|
||||
public static SQLiteConnection Deserialize(this SQLiteConnection db, byte[] buffer, long usedSize, string schema = null, SQLite3.DeserializeFlags flags = SQLite3.DeserializeFlags.None)
|
||||
{
|
||||
SQLite3.Result result = SQLite3.Deserialize(db.Handle, schema, buffer, usedSize, buffer.LongLength, flags);
|
||||
if (result != SQLite3.Result.OK)
|
||||
{
|
||||
throw SQLiteException.New(result, SQLite3.GetErrmsg(db.Handle));
|
||||
}
|
||||
return db;
|
||||
}
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
public static SQLiteConnection Deserialize(this SQLiteConnection db, NativeArray<byte> buffer, string schema = null, SQLite3.DeserializeFlags flags = SQLite3.DeserializeFlags.None)
|
||||
{
|
||||
return Deserialize(db, buffer, buffer.Length, schema, flags);
|
||||
}
|
||||
|
||||
public static SQLiteConnection Deserialize(this SQLiteConnection db, NativeArray<byte> buffer, long usedSize, string schema = null, SQLite3.DeserializeFlags flags = SQLite3.DeserializeFlags.None)
|
||||
{
|
||||
SQLite3.Result result;
|
||||
unsafe
|
||||
{
|
||||
result = SQLite3.Deserialize(db.Handle, schema, buffer.GetUnsafePtr(), usedSize, buffer.Length, flags);
|
||||
}
|
||||
if (result != SQLite3.Result.OK)
|
||||
{
|
||||
throw SQLiteException.New(result, SQLite3.GetErrmsg(db.Handle));
|
||||
}
|
||||
return db;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
public static SQLiteConnection Deserialize(this SQLiteConnection db, ReadOnlySpan<byte> buffer, string schema = null, SQLite3.DeserializeFlags flags = SQLite3.DeserializeFlags.None)
|
||||
{
|
||||
return Deserialize(db, buffer, buffer.Length, schema, flags);
|
||||
}
|
||||
|
||||
public static SQLiteConnection Deserialize(this SQLiteConnection db, ReadOnlySpan<byte> buffer, long usedSize, string schema = null, SQLite3.DeserializeFlags flags = SQLite3.DeserializeFlags.None)
|
||||
{
|
||||
SQLite3.Result result;
|
||||
unsafe
|
||||
{
|
||||
fixed (void* ptr = buffer)
|
||||
{
|
||||
result = SQLite3.Deserialize(db.Handle, schema, ptr, usedSize, buffer.Length, flags);
|
||||
}
|
||||
}
|
||||
if (result != SQLite3.Result.OK)
|
||||
{
|
||||
throw SQLiteException.New(result, SQLite3.GetErrmsg(db.Handle));
|
||||
}
|
||||
return db;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30836eea2610b493c892439e371095e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
119
Assets/External/Models/SidekickCharacters/Plugins/unity-sqlite-net-1.2.4/Runtime/SQLiteExtensions.cs
vendored
Normal file
119
Assets/External/Models/SidekickCharacters/Plugins/unity-sqlite-net-1.2.4/Runtime/SQLiteExtensions.cs
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Gil Barbosa Reis
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SQLite
|
||||
{
|
||||
public static partial class SQLite3
|
||||
{
|
||||
[Flags]
|
||||
public enum SerializeFlags : uint
|
||||
{
|
||||
None,
|
||||
NoCopy = 0x001, /* Do no memory allocations */
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum DeserializeFlags : uint
|
||||
{
|
||||
None,
|
||||
FreeOnClose = 1, /* Call sqlite3_free() on close */
|
||||
Resizeable = 2, /* Resize using sqlite3_realloc64() */
|
||||
ReadOnly = 4, /* Database is read-only */
|
||||
}
|
||||
|
||||
[DllImport(LibraryPath, EntryPoint = "sqlite3_serialize", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Serialize(IntPtr db, [MarshalAs(UnmanagedType.LPStr)] string zSchema, out long piSize, SerializeFlags mFlags);
|
||||
|
||||
[DllImport(LibraryPath, EntryPoint = "sqlite3_deserialize", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Result Deserialize(IntPtr db, [MarshalAs(UnmanagedType.LPStr)] string zSchema, byte[] pData, long szDb, long szBuf, DeserializeFlags mFlags);
|
||||
|
||||
[DllImport(LibraryPath, EntryPoint = "sqlite3_deserialize", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static unsafe extern Result Deserialize(IntPtr db, [MarshalAs(UnmanagedType.LPStr)] string zSchema, void* pData, long szDb, long szBuf, DeserializeFlags mFlags);
|
||||
|
||||
[DllImport(LibraryPath, EntryPoint = "sqlite3_malloc", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Malloc(int size);
|
||||
|
||||
[DllImport(LibraryPath, EntryPoint = "sqlite3_malloc64", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Malloc(long size);
|
||||
|
||||
[DllImport(LibraryPath, EntryPoint = "sqlite3_realloc", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Realloc(IntPtr ptr, int size);
|
||||
|
||||
[DllImport(LibraryPath, EntryPoint = "sqlite3_realloc64", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr Realloc(IntPtr ptr, long size);
|
||||
|
||||
[DllImport(LibraryPath, EntryPoint = "sqlite3_free", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Free(IntPtr ptr);
|
||||
|
||||
[DllImport(LibraryPath, EntryPoint = "sqlite3_column_bytes16", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int ColumnBytes16(IntPtr stmt, int index);
|
||||
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
[DllImport(LibraryPath, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int idbvfs_register(int makeDefault);
|
||||
#endif
|
||||
|
||||
static SQLite3()
|
||||
{
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
idbvfs_register(1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public static class ISQLiteConnectionExtensions
|
||||
{
|
||||
public static int Insert<T>(this ISQLiteConnection connection, ref T obj)
|
||||
{
|
||||
object boxed = obj;
|
||||
int result = connection.Insert(boxed);
|
||||
obj = (T) boxed;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int Insert<T>(this ISQLiteConnection connection, ref T obj, Type objType)
|
||||
{
|
||||
object boxed = obj;
|
||||
int result = connection.Insert(boxed, objType);
|
||||
obj = (T) boxed;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int Insert<T>(this ISQLiteConnection connection, ref T obj, string extra)
|
||||
{
|
||||
object boxed = obj;
|
||||
int result = connection.Insert(boxed, extra);
|
||||
obj = (T) boxed;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int Insert<T>(this ISQLiteConnection connection, ref T obj, string extra, Type objType)
|
||||
{
|
||||
object boxed = obj;
|
||||
int result = connection.Insert(boxed, extra, objType);
|
||||
obj = (T) boxed;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5efe130b84bb4bd48a419af53aaf741
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,265 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Gil Barbosa Reis
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SQLite
|
||||
{
|
||||
/// <summary>
|
||||
/// Low level SQLite prepared statement object.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Using this is the same as using prepared statments in the SQLite C API.
|
||||
/// You need to bind all arguments to the statement, manually step for each row and until done, get values from the
|
||||
/// returned columns, manually reset for subsequent executions, then dispose when not needed anymore.
|
||||
/// </remarks>
|
||||
public class SQLitePreparedStatement : IDisposable
|
||||
{
|
||||
private static readonly IntPtr SQLITE_STATIC = IntPtr.Zero;
|
||||
|
||||
private SQLiteConnection _db;
|
||||
private IntPtr _preparedStatement;
|
||||
|
||||
public SQLitePreparedStatement(SQLiteConnection db, string statement)
|
||||
{
|
||||
if (db == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(db));
|
||||
}
|
||||
|
||||
_db = db;
|
||||
_preparedStatement = SQLite3.Prepare2(db.Handle, statement);
|
||||
}
|
||||
|
||||
~SQLitePreparedStatement()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public SQLite3.Result Reset()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return SQLite3.Reset(_preparedStatement);
|
||||
}
|
||||
|
||||
public SQLite3.Result Bind(int index, bool value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return (SQLite3.Result) SQLite3.BindInt(_preparedStatement, index, value ? 1 : 0);
|
||||
}
|
||||
public SQLite3.Result Bind(string name, bool value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
int index = SQLite3.BindParameterIndex(_preparedStatement, name);
|
||||
return Bind(index, value);
|
||||
}
|
||||
|
||||
public SQLite3.Result Bind(int index, int value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return (SQLite3.Result) SQLite3.BindInt(_preparedStatement, index, value);
|
||||
}
|
||||
public SQLite3.Result Bind(string name, int value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
int index = SQLite3.BindParameterIndex(_preparedStatement, name);
|
||||
return Bind(index, value);
|
||||
}
|
||||
|
||||
public SQLite3.Result Bind(int index, long value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return (SQLite3.Result) SQLite3.BindInt64(_preparedStatement, index, value);
|
||||
}
|
||||
public SQLite3.Result Bind(string name, long value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
int index = SQLite3.BindParameterIndex(_preparedStatement, name);
|
||||
return Bind(index, value);
|
||||
}
|
||||
|
||||
public SQLite3.Result Bind(int index, float value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return (SQLite3.Result) SQLite3.BindDouble(_preparedStatement, index, value);
|
||||
}
|
||||
public SQLite3.Result Bind(string name, float value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
int index = SQLite3.BindParameterIndex(_preparedStatement, name);
|
||||
return Bind(index, value);
|
||||
}
|
||||
|
||||
public SQLite3.Result Bind(int index, double value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return (SQLite3.Result) SQLite3.BindDouble(_preparedStatement, index, value);
|
||||
}
|
||||
public SQLite3.Result Bind(string name, double value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
int index = SQLite3.BindParameterIndex(_preparedStatement, name);
|
||||
return Bind(index, value);
|
||||
}
|
||||
|
||||
public SQLite3.Result Bind(int index, string value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return (SQLite3.Result) SQLite3.BindText(_preparedStatement, index, value, value.Length * sizeof(char), SQLITE_STATIC);
|
||||
}
|
||||
public SQLite3.Result Bind(string name, string value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
int index = SQLite3.BindParameterIndex(_preparedStatement, name);
|
||||
return Bind(index, value);
|
||||
}
|
||||
|
||||
public SQLite3.Result Bind(int index, byte[] value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return (SQLite3.Result) SQLite3.BindBlob(_preparedStatement, index, value, value.Length, SQLITE_STATIC);
|
||||
}
|
||||
public SQLite3.Result Bind(string name, byte[] value)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
int index = SQLite3.BindParameterIndex(_preparedStatement, name);
|
||||
return Bind(index, value);
|
||||
}
|
||||
|
||||
public int BindParameterIndex(string name)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return SQLite3.BindParameterIndex(_preparedStatement, name);
|
||||
}
|
||||
|
||||
public SQLite3.Result Step()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
var result = SQLite3.Step(_preparedStatement);
|
||||
if (result > SQLite3.Result.OK && result < SQLite3.Result.Row)
|
||||
{
|
||||
throw SQLiteException.New(result, SQLite3.GetErrmsg(_db.Handle));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int GetColumnCount()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return SQLite3.ColumnCount(_preparedStatement);
|
||||
}
|
||||
|
||||
public string GetColumnName(int column)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return SQLite3.ColumnName16(_preparedStatement, column);
|
||||
}
|
||||
|
||||
public IEnumerable<string> EnumerateColumnNames()
|
||||
{
|
||||
for (int i = 0, columnCount = GetColumnCount(); i < columnCount; i++)
|
||||
{
|
||||
yield return GetColumnName(i);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<string> EnumerateColumnsAsText()
|
||||
{
|
||||
for (int i = 0, columnCount = GetColumnCount(); i < columnCount; i++)
|
||||
{
|
||||
yield return GetString(i);
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetBool(int column)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return SQLite3.ColumnInt(_preparedStatement, column) != 0;
|
||||
}
|
||||
|
||||
public int GetInt(int column)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return SQLite3.ColumnInt(_preparedStatement, column);
|
||||
}
|
||||
|
||||
public long GetLong(int column)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return SQLite3.ColumnInt64(_preparedStatement, column);
|
||||
}
|
||||
|
||||
public float GetFloat(int column)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return (float) SQLite3.ColumnDouble(_preparedStatement, column);
|
||||
}
|
||||
|
||||
public double GetDouble(int column)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return SQLite3.ColumnDouble(_preparedStatement, column);
|
||||
}
|
||||
|
||||
public string GetString(int column)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
IntPtr ptr = SQLite3.ColumnText16(_preparedStatement, column);
|
||||
if (ptr == IntPtr.Zero)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
int sizeInBytes = SQLite3.ColumnBytes16(_preparedStatement, column);
|
||||
return Marshal.PtrToStringUni(ptr, sizeInBytes / sizeof(char));
|
||||
}
|
||||
|
||||
public byte[] GetBytes(int column)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
IntPtr blob = SQLite3.ColumnBlob(_preparedStatement, column);
|
||||
if (blob == IntPtr.Zero)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
int sizeInBytes = SQLite3.ColumnBytes(_preparedStatement, column);
|
||||
var value = new byte[sizeInBytes];
|
||||
Marshal.Copy(blob, value, 0, sizeInBytes);
|
||||
return value;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
SQLite3.Finalize(_preparedStatement);
|
||||
_preparedStatement = IntPtr.Zero;
|
||||
_db = null;
|
||||
}
|
||||
|
||||
private void ThrowIfDisposed()
|
||||
{
|
||||
if (_preparedStatement == IntPtr.Zero)
|
||||
{
|
||||
throw new ObjectDisposedException(nameof(_preparedStatement));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f832e590cb784ed490bb3c248063980
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fdd42b002eaee4f7e9226d236c618bf7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SQLite-net Official Portable Library")]
|
||||
[assembly: AssemblyDescription("Light weight library providing easy SQLite database storage")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Krueger Systems, Inc.")]
|
||||
[assembly: AssemblyProduct("SQLite-net")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c9be88643c0c40be8577f5969655b43
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
Copyright (c) Krueger Systems, Inc.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c88e95b456274e3d8541f961a49a403
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
4998
Assets/External/Models/SidekickCharacters/Plugins/unity-sqlite-net-1.2.4/Runtime/sqlite-net/SQLite.cs
vendored
Normal file
4998
Assets/External/Models/SidekickCharacters/Plugins/unity-sqlite-net-1.2.4/Runtime/sqlite-net/SQLite.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ba12ff0c4a47416fbd764e8214ca6c9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cad9e8fa279d240a093308d4bad79e29
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user