You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clone this repository or download a snapshot of it directly inside your project's Assets or Packages folder.
Basic usage
usingGilzoide.KeyValueStore.Sqlite;usingUnityEngine;// 1. Instantiate a SqliteKeyValueStore with the desired pathvardatabasePath=$"{Application.persistentDataPath}/MySaveFile.db";varkvs=newSqliteKeyValueStore(databasePath);// 2. Set/Get/Delete valueskvs.SetBool("finishedTutorial",true);kvs.SetString("username","gilzoide");Debug.Log("Checking if values exist: "+kvs.HasKey("username"));Debug.Log("Getting values: "+kvs.GetInt("username"));Debug.Log("Getting values with fallback: "+kvs.GetString("username","default username"));// Like C# Dictionary, this idiom returns a bool if the key is foundif(kvs.TryGetString("someKey",outstringfoundValue)){Debug.Log("'someKey' exists: "+foundValue);}kvs.DeleteKey("someKey");// 3. Dispose of the SqliteKeyValueStore when done// This ensures the database connection gets closed correctlykvs.Dispose();
About
Key-Value Store implementation backed by the SQLite database engine