OptimaDB supports a wide range of Data Types from the basic Int, Float and Text to more advanced ones like UUID, Email and Password.
Here is a full list of the Types OptimaDB offers:
Int
Float
Text
Boolean
Time
UUID
Password
Array
Json
Typescript Type
number
number
string
boolean
Date
string
string
string
Array
Object
Type Checking
None
None
None
None
Compile Time
Run Time
Run Time
None
Compile Time
Compile Time
Options
notNulldefaultenumprimaryKeyuniquecheckautoIncrement
notNulldefaultenumprimaryKeyuniquecheck
notNulldefaultenumprimaryKeyuniquecheck
notNulldefaultcheck
notNulldefaultenumuniquecheck
notNulldefaultenumprimaryKeyuniquecheck
notNulldefaultenumprimaryKeycheck
notNullcheck
notNulldefaultenumuniquecheck
notNulldefaultenumuniquecheck
* Disclaimer: Types are subject to change and more will be added and improved
Integer type for whole numbers (stored as INTEGER). Supports primary keys and autoincrement, making it ideal for IDs, counters, and any field where only whole numbers are valid. Ensures efficient storage and fast numeric operations.
typescript
1
2
3
4
5
Floating point type for decimals (stored as REAL). Useful for prices, measurements, or any value that requires fractional precision. Does not support autoincrement, but allows for flexible numeric data with decimal points.
typescript
1
2
3
4
5
String text (stored as TEXT). Can be marked as unique or checked with custom validators for length, format, or content. Suitable for names, descriptions, and any arbitrary string data. Supports flexible text storage and searching.
typescript
1
2
3
4
5
Boolean true/false (stored as INTEGER 0/1). Enum is fixed to [false, true], ensuring strict type safety. Perfect for flags, toggles, and any field that represents a binary state. Integrates seamlessly with TypeScript's boolean type.
typescript
1
2
3
4
5
Date/time (stored as ISO TEXT). Automatically formatted in/out to JavaScript Date objects, making it easy to work with timestamps, creation dates, or scheduling. Ensures consistent date handling and supports default values.
typescript
1
2
3
4
5
Email string with runtime format validation. Ensures only valid email addresses are stored, and can be set as unique to prevent duplicates. Useful for user accounts, contact fields, and any scenario requiring verified email addresses.
typescript
1
2
3
4
5
UUID string (v1–v5) with built-in validation. Uniqueness defaults to true, making it ideal for distributed systems or public identifiers. Guarantees globally unique values for records, supporting both random and time-based UUIDs.
typescript
1
2
3
4
5
Passwords are automatically hashed and salted for maximum security. OptimaDB handles secure storage and verification transparently, so you never store plain text passwords. Designed for user authentication and sensitive credentials.
typescript
1
2
3
4
5
Array of values (stored as JSON TEXT). Automatically JSON-serialized/deserialized, allowing you to store lists of items, tags, or any collection of values. Supports flexible and dynamic data structures within a single field.
typescript
1
2
3
4
5
Arbitrary JSON object (stored as JSON TEXT). Automatically serialized/deserialized, making it easy to store complex, nested data such as user preferences, settings, or metadata. Enables flexible schema design for evolving requirements.
typescript
1
2
3
4
5