Registry / database / com.fluid.database

com.fluid.database

JSON →
library2.1.0jsnpmunverified

A Unity package providing a simple key-value pair database supporting int, float, string, and bool types, with extensibility to custom types via generics. Current stable version is 2.1.0 (released 2021-01-05). The package is installed via Unity's Package Manager from the npm registry under the com.fluid scope. It uses Unity Events for change notifications and includes a global bool monitor component. Compared to PlayerPrefs or scriptable objects, Fluid Database offers type safety, a generic API, and editor integration.

npm install com.fluid.database
INSTALL
IMPORT
SIG · COM.FLUID.DATABASE
C
com.fluid.database
databasejavascriptv2.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FluidDatabase
using FluidDatabase;
using Fluid.Database;
Namespace is FluidDatabase, not Fluid.Database.
IntDatabase
public IntDatabase intDb = new IntDatabase();
IntDatabase intDb = new IntDatabase();
Types like IntDatabase inherit from ScriptableObject; should be used as assets via CreateAssetMenu.
IDatabase<T>
public class MyCustomDatabase : Database<MyType> { }
public class MyCustomDatabase : Database {}
Generic Database requires type parameter; custom databases must inherit from Database<T>.

Shows basic usage of IntDatabase: set a value, get it, and check existence.

using FluidDatabase; using UnityEngine; public class Example : MonoBehaviour { public IntDatabase intDb; void Start() { if (intDb != null) { intDb.Set("score", 100); Debug.Log("Score: " + intDb.Get<int>("score", 0)); Debug.Log("Has key 'score': " + intDb.Has("score")); } } }
Debug
Known issues
breakingIn v2.0.0, events were replaced with Unity Event Plus. Existing components using built-in events will break.
fix
Update event listeners to use UnityEventPlus or migrate to the new event system.
affects: >=2.0.0
breakingIn v2.0.0, global bool monitor component now uses array values instead of single bool. Existing monitor components will lose their value.
fix
Re-assign the bool values in the array field of the global bool monitor.
affects: >=2.0.0
gotchaPackage requires scopedRegistry configuration. Without it, Unity cannot resolve the package from npm.
fix
Add scopedRegistries entry as shown in the installation instructions.
affects: >=0.0.0
deprecatedDocumentation mentions old event system that was removed in v2.0.0.
fix
Refer to the new UnityEventPlus documentation.
affects: >=2.0.0
Errors
Common errors & fixes
error CS0246: The type or namespace name 'FluidDatabase' could not be found
Missing using directive or package not installed.
fix
Add 'using FluidDatabase;' at top of script and ensure package is installed via package manager.
Failed to resolve package: com.fluid.database
Missing scoped registry in Packages/manifest.json.
fix
Add scopedRegistry for 'com.fluid' in manifest.json.
ArgumentException: The requested value type does not match the stored type.
Calling Get<T> with a type different from the stored type.
fix
Ensure T matches the type used in Set. Prefer using typed database (e.g., IntDatabase) instead of generic <T>.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
com.fluid.unity-event-plusrequiredReplaced built-in events with Unity Event Plus package in v2.0.0
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
com.fluid.database — npm install com.fluid.database · libregistry