SupportedIdType class
Supported ID type definitions.
All configuration to support other types is done only on this class. A
supported id type is a combination of a type and a default value. It is
possible to support multiple default values for a same type (e.g. uuid type
with default of versions 4 and 7), with each having its getter. For new
entries, add a new static getter and update the all getter. If the entry
contains a type not yet used by existing id types, it's necessary to update
the Table
constructor at packages:serverpod/src/database/concepts/table.dart
.
Constructors
-
SupportedIdType.new({required TypeDefinition type, required List<
String> aliases, required String defaultValue}) -
const
Properties
-
aliases
→ List<
String> -
The aliases for the id type as exposed to the user. Supports multiple,
even though it is not recommended to use more than one to avoid confusion.
final
- defaultValue → String
-
The default value for the column on the database definition. Must be one
of the supported defaults for the type.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → TypeDefinition
-
The supported id type.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
all
→ List<
SupportedIdType> -
All supported id types.
no setter
- int → SupportedIdType
-
Id type that generates sequential integer values.
no setter
-
userOptions
→ List<
String> -
All aliases exposed to the user.
no setter
- uuidV4 → SupportedIdType
-
Id type that generates UUID v4 values.
no setter
- uuidV7 → SupportedIdType
-
Id type that generates UUID v7 values.
no setter
Static Methods
-
fromString(
String input) → SupportedIdType - Get the SupportedIdType from a valid string alias. If the input is invalid, will throw a FormatException.