cosmos-sdk/schema
Aaron Craelius e7844e640c
feat(schema): testing utilities (#20705)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-07-31 06:58:30 +00:00
..
appdata feat(schema): testing utilities (#20705) 2024-07-31 06:58:30 +00:00
decoding chore(all): replace all fmt.Errorf without paramters with errors.New (#21068) 2024-07-25 14:54:49 +02:00
indexer feat(schema): indexing API (#20647) 2024-07-09 11:20:31 +00:00
logutil feat(schema): indexing API (#20647) 2024-07-09 11:20:31 +00:00
testing feat(schema): testing utilities (#20705) 2024-07-31 06:58:30 +00:00
CHANGELOG.md refactor(indexer/base): move to cosmossdk.io/schema (#20744) 2024-06-26 15:46:08 +00:00
decoder.go feat(schema/appdata)!: packet support and small refactorings (#20860) 2024-07-04 13:43:49 +00:00
enum_test.go feat(schema)!: add more range methods, rename EnumDefinition -> EnumType (#21043) 2024-07-24 13:42:47 +00:00
enum.go feat(schema)!: add more range methods, rename EnumDefinition -> EnumType (#21043) 2024-07-24 13:42:47 +00:00
field_test.go feat(schema)!: add more range methods, rename EnumDefinition -> EnumType (#21043) 2024-07-24 13:42:47 +00:00
field.go feat(schema)!: add more range methods, rename EnumDefinition -> EnumType (#21043) 2024-07-24 13:42:47 +00:00
fields_test.go feat(schema)!: updates based on postgres testing (#20858) 2024-07-04 19:46:42 +00:00
fields.go feat(schema)!: updates based on postgres testing (#20858) 2024-07-04 19:46:42 +00:00
go.mod refactor(indexer/base): move to cosmossdk.io/schema (#20744) 2024-06-26 15:46:08 +00:00
kind_test.go feat(schema): testing utilities (#20705) 2024-07-31 06:58:30 +00:00
kind.go feat(schema): testing utilities (#20705) 2024-07-31 06:58:30 +00:00
module_schema_test.go fix(stf): fixes to make init genesis pass (#21088) 2024-07-27 18:11:24 +00:00
module_schema.go feat(schema)!: add more range methods, rename EnumDefinition -> EnumType (#21043) 2024-07-24 13:42:47 +00:00
name_test.go refactor(indexer/base): move to cosmossdk.io/schema (#20744) 2024-06-26 15:46:08 +00:00
name.go refactor(indexer/base): move to cosmossdk.io/schema (#20744) 2024-06-26 15:46:08 +00:00
object_type_test.go feat(schema)!: add more range methods, rename EnumDefinition -> EnumType (#21043) 2024-07-24 13:42:47 +00:00
object_type.go feat(schema)!: add more range methods, rename EnumDefinition -> EnumType (#21043) 2024-07-24 13:42:47 +00:00
object_update_test.go refactor(indexer/base): move to cosmossdk.io/schema (#20744) 2024-06-26 15:46:08 +00:00
object_update.go refactor(indexer/base): move to cosmossdk.io/schema (#20744) 2024-06-26 15:46:08 +00:00
README.md refactor(indexer/base): move to cosmossdk.io/schema (#20744) 2024-06-26 15:46:08 +00:00
sonar-project.properties ci: enable ci for schema (#20888) 2024-07-05 10:52:49 +00:00
type.go feat(schema)!: add more range methods, rename EnumDefinition -> EnumType (#21043) 2024-07-24 13:42:47 +00:00

Logical State Schema Framework

The cosmossdk.io/schema base module is designed to provide a stable, zero-dependency base layer for specifying the logical representation of module state schemas and implementing state indexing. This is intended to be used primarily for indexing modules in external databases and providing a standard human-readable state representation for genesis import and export.

The schema defined in this library does not aim to be general purpose and cover all types of schemas, such as those used for defining transactions. For instance, this schema does not include many types of composite objects such as nested objects and arrays. Rather, the schema defined here aims to cover state schemas only which are implemented as key-value pairs and usually have direct mappings to relational database tables or objects in a document store.

Also, this schema does not cover physical state layout and byte-level encoding, but simply describes a common logical format.

HasModuleCodec Interface

Any module which supports logical decoding and/or encoding should implement the HasModuleCodec interface. This interface provides a way to get the codec for the module, which can be used to decode the module's state and/or apply logical updates.

State frameworks such as collections or orm should directly provide ModuleCodec implementations so that this functionality basically comes for free if a compatible framework is used. Modules that do not use one of these frameworks can choose to manually implement logical decoding and/or encoding.