Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/track/gilzoide-sqlite.git

README

SQLite Key-Value Store for Unity

openupm

Key-Value Store implementation backed by the SQLite database engine.

Features

  • Easy to use API similar to PlayerPrefs
  • Automatic management of transactions, optimizing throughput. Write operations are commited automatically once per frame.
  • Custom serialization of complex objects (class/struct types), using Key-Value Store's serialization system
  • Supports running PRAGMA statements for customization of the database
  • Supports running VACUUM statements manually

Dependencies

  • Key-Value Store: interface used by this implementation, which also provides custom object serialization out of the box.
  • SQLite-net: library for managing SQLite databases

How to install

Either:

  • Use the openupm registry and install this package using the openupm-cli:
    openupm add com.gilzoide.key-value-store.sqlite
    
  • Install using the Unity Package Manager with the following URL:
    https://github.com/gilzoide/unity-key-value-store-sqlite.git#1.0.0-preview2
    
  • Clone this repository or download a snapshot of it directly inside your project's Assets or Packages folder.

Basic usage

using Gilzoide.KeyValueStore.Sqlite;
using UnityEngine;

// 1. Instantiate a SqliteKeyValueStore with the desired path
var databasePath = $"{Application.persistentDataPath}/MySaveFile.db";
var kvs = new SqliteKeyValueStore(databasePath);


// 2. Set/Get/Delete values
kvs.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 found
if (kvs.TryGetString("someKey", out string foundValue))
{
    Debug.Log("'someKey' exists: " + foundValue);
}

kvs.DeleteKey("someKey");


// 3. Dispose of the SqliteKeyValueStore when done
// This ensures the database connection gets closed correctly
kvs.Dispose();
Total Installs
0
Last 30 days
Unique IPs
0
Approximate users

Installs Over Time

Operating Systems

No data yet

Top Countries

No data yet

Git Versions

No data yet

Embed Install Badge

Add an install count badge to your README

Style
Preview
pkglnk installs badge
Markdown
[![pkglnk installs](https://www.pkglnk.dev/badge/gilzoide-sqlite.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/gilzoide-sqlite)
HTML
<a href="https://www.pkglnk.dev/pkg/gilzoide-sqlite"><img src="https://www.pkglnk.dev/badge/gilzoide-sqlite.svg?style=pkglnk" alt="pkglnk installs"></a>

Comments

No comments yet. Be the first!