Errors

A call can fail because a definition is missing, a document is invalid, or the database refuses a change. The examples use the people data to show these results. Use the status and diagnostic fields to identify the failure.

Binding errors

LanguageFailure
CReturns a status. The owner that its operation names holds the diagnostic.
GoReturns *Error.
RustReturns Result<_, Error>.
ClojureThrows clojure.lang.ExceptionInfo with diagnostic data.
PythonRaises StardustError.
OdinReturns an Error beside its result.

Schema-constrained mutations return code schema_validation and message Schema validation failed.. Their violations list identifies each entity, schema and failed keyword. Each entry has entityPath and schemaPath arrays, such as [title] and [properties title minLength]. A token matching 0|[1-9][0-9]* within i64 is an integer, including when it names an object key. Other tokens are strings. The root is []; the empty-string key is [""]. Path arrays use decoded tokens, so / and ~ need no escaping. Constraint and actual values retain their data types. Missing required members report missingProperty instead of an actual value. Clojure uses kebab-case keys, such as :entity-path and :constraint-value.

The error record gives the fields in your language. Statuses gives the failure conditions of each operation.

error

This record describes a failure with its status and diagnostic. The binding copies the diagnostic before it releases the native owner.

FieldTypeUnitAbsentMeaning
violations[]map[string]anyNone—The binding copies schema violations before the failed owner closes. Each entry contains entity and schema identities, entityPath and schemaPath arrays, and a keyword. Canonical decimal tokens within i64 are integers, including object keys. Other tokens are strings. An empty array selects the root. Entries include applicable constraintValue, actualValue, actualLength or missingProperty data. The error code remains schema_validation.
codestringNone——
messagestringNone——
path*stringNonenil—
field*stringNonenil—
entity*int64Nonenil—
offset*int64Bytesnil—
statusStatusNone——

Statuses

Each status names a class of failure. The table lists codes from the binding. Native diagnostic codes can differ.

StatusInvalidArgument

Codes: time_out_of_range, invalid_argument, out_of_range, non_finite_number, cycle, unsupported_type, too_large, native_failure, live_children, wrong_kind, not_integral, inexact_number, missing_field, unknown_field, duplicate_field, too_deep, length_mismatch, malformed_tag, ambiguous_field, ambiguous_variant, invalid_value, hook_failed.

WhenOperations
the bundle, schemaPath or node is invalid or an input exceeds its limitValidateSchema
the entity ID is outside the user entity range, max_depth is negative or above 32, or max_entities is negativeDatabase.ReadEntity
the text is malformed, the format is unknown or a number is outside i64 or finite f64Parse
the format is unknown or the width is negativeDocument.Serialize
the text is malformed, a format is unknown or the width is negativeConvert
the value has a host type with no document form (one the language's standard JSON encoder also refuses), a number outside i64 or finite f64, a decimal or time with no exact native form, a failing conversion method, or a cycleFromValue
the node breaks the preorder rules or has an invalid kind or numberBuilder.Add
a node breaks the preorder rules or has an invalid kind or numberBuilder.AddMany
the builder has no root or a container is still openBuilder.Seal
id is not a node of the documentDocument.Read, Document.Pointer, Document.Children
start is past the last node or capacity is negativeDocument.ReadMany
id is not an object node of the documentDocument.Member, Document.Members
a path token is neither a string nor an int or int64Document.Pointer, pointer.Format
the node is not an integer numberDocument.I64
the node is not a number or its value overflows f64Document.F64
the arguments include an undeclared macro parameterBuildMacro, ExpandMacro
the file is not a database, an option is invalid, selected plugins are incompatible, or a plugin refuses its settings: the error carries the plugin's code (such as unknown_plugin_setting), the plugin's name as its path and the setting at fault as its field (nested settings as dotted member names, ambiguous when a name holds a dot)Open
the parameters or run options are invalidQuery.Run
the parameters or subscription options are invalidQuery.Subscribe
max_wait is negativeSubscription.Next, Database.IndexesSync
the parameters or run options are invalid, or a required parameter has no valueMutation.Run
the patch is not an entity-keyed object, or a link names an ID outside the user entity rangeDatabase.MergePatch
the kind, action, revision or page limits are invalid, or the selected plan cannot run the current authored definitionDatabase.Plan
the kind or the pattern is invalidDatabase.Definitions
a bulk build is already in progress on the databaseDatabase.BulkBegin
no bulk build is in progressDatabase.BulkAdd, Database.BulkFinish
a name is empty, the plugin has no call operation with the name, or the plugin refuses the requestDatabase.PluginCall
a name is empty, the plugin has no stream operation with the name, or the plugin refuses the requestDatabase.PluginStream
the stream has finished or does not accept writesPluginStream.Write
the stream does not support reads, or length is negativePluginStream.Read
the stream does not support seeks, whence is unknown, or the position is negative or past the i64 rangePluginStream.Seek
the stream has finished or has no finish stepPluginStream.Finish
the token is empty or longer than 4096 bytesActivate
entity is not a user entityObjects.Get, Objects.Path
the parent or the name is invalid, or the parent is a fileObjects.Lookup
the parent is invalid or is a fileObjects.Children
the digest is not a native SHA-256 valueObjects.Files, Objects.Manifest, Objects.Open
the array is empty or malformed, a name is invalid, or a parent is a fileObjects.Create
the entity is a directory or invalid, the digest is malformed, or expected_revision is negativeObjects.Update
the request is malformed, the destination is a file or inside the node, the kinds differ, or a replaced directory is not emptyObjects.Move
the entity is invalid, the directory is not empty, or expected_revision is negativeObjects.Remove
the request is not an object with only an integer ownerEvents.CloseOwner
event is not an object with exactly subject and data, the subject is malformed (code invalid_subject), or data exceeds 1 MB (code too_large)Events.Publish
the request is malformed, or the pattern is empty or not a valid regular expression (code invalid_pattern)Events.Subscribe
options is not an object with owner and subscription (integers) and optionally a valid maxWait, or the subscription belongs to another owner (code wrong_owner)Events.Receive
the request is malformed, or the subscription belongs to another owner (code wrong_owner)Events.Unsubscribe
the request is malformed, the mode is unknown (code invalid_mode) or the pattern is empty or invalid (code invalid_pattern)Events.Register
the request is malformed, or the registration belongs to another owner (code wrong_owner)Events.Unregister
options is not an object with owner and registration (integers) and optionally a valid maxWait, or the registration belongs to another owner (code wrong_owner)Events.Accept
request is malformed, the mode or subject is invalid (codes invalid_mode and invalid_subject), data is missing for request or pull, present for push or duplex, or exceeds 1 MB, or data does not match the stored request schema (code invalid_payload)Events.Call
request is malformed, the side may not send now (code wrong_direction), the handle belongs to another owner (code wrong_owner), or data does not match its schema (code invalid_payload)Events.Send
the request is malformed, the side cannot finish in this mode (code wrong_direction), or the handle belongs to another owner (code wrong_owner)Events.Finish
the request is malformed, or the handle belongs to another owner (code wrong_owner)Events.Cancel
options is not an object with owner and handle (integers) and optionally a valid maxWait, or the handle belongs to another owner (code wrong_owner)Events.Read
the request is malformed, the parameters do not fit the query, a selected target is a reserved field or not a data entity, or rows disagree about one entity fieldBlackholes.Preview
the request is malformed, confirm is wrong, the parameters do not fit the query, a selected target is a reserved field or not a data entity, or rows disagree about one entity fieldBlackholes.Execute
options is not an object, or an option is invalid or unsupportedBlackholes.Audit
options is not an object, or an option is invalid, duplicated or unsupportedBackups.Sync, Sdk.Sync, Skills.Sync

StatusInvalidJSON

WhenOperations
JSON text is malformedParse, Convert

StatusCompileFailed

WhenOperations
the expression does not compileBuild
the expansion does not compileBuildMacro
the expanded expression does not compileDatabase.Expression

StatusEvaluationFailed

WhenOperations
the validation work limit is exceededValidateSchema
the expression fails on the inputProgram.Evaluate
the query fails, exceeds max_cost or exceeds its automatic work limitQuery.Run
the page does not renderRows.Next
a page does not renderRows.Pages, Rows.AllPages
a rerun of the query failed. Every later call reports this failureSubscription.Next
a rerun of the query failedSubscription.All
the mutation failsMutation.Run
the plugin cannot read its stored stateDatabase.PluginCall, Database.PluginStream
stored bytes do not match their digestPluginStream.Read
stored tree metadata or the manifest of a named payload is corruptedObjects.Get, Objects.Lookup, Objects.Children, Objects.Path
the stored manifest is corruptedObjects.Manifest, Objects.Open
a replacement expression fails or exceeds its work limit. History stays unchangedBlackholes.Preview, Blackholes.Execute

StatusOutOfMemory

Codes: out_of_memory.

StatusNotFound

Codes: not_found.

WhenOperations
the object has no member with the keyDocument.Member
the macro refers to an unknown macroBuildMacro, ExpandMacro
the parent directory is missing, or the file is missing and create is falseOpen
no definition is stored at the pathDatabase.Query, Database.Mutation, Database.Definition
no expression is stored at the pathDatabase.Expression
the stored query definition was deletedQuery.Run
the definition or exact historical plan revision does not existDatabase.Plan
the plugin reports that the request names nothing it holdsDatabase.PluginCall, Database.PluginStream
no object node has the entityObjects.Get
the parent has no child with the name, or the parent does not existObjects.Lookup
the parent does not existObjects.Children
the node or one of its ancestors does not existObjects.Path
no payload with the digest is publishedObjects.Manifest, Objects.Open
a parent does not exist or a digest is not publishedObjects.Create
the file does not exist or the digest is not publishedObjects.Update
the node or the destination does not existObjects.Move
the node does not existObjects.Remove
the owner does not exist or endedEvents.CloseOwner
the owner does not existEvents.Subscribe, Events.Register
the owner or the subscription does not existEvents.Receive
the owner or the subscription does not exist or endedEvents.Unsubscribe
the owner or the registration does not existEvents.Unregister, Events.Accept
the owner does not exist, or no registered worker matches (code no_worker)Events.Call
the owner or the side does not exist, or the exchange ended and the side drainedEvents.Send
the owner or the side does not existEvents.Finish, Events.Cancel
the owner or the side does not exist, or it drained after the exchange endedEvents.Read
no definition has the path (code not_found), or the selection has no assertion to rewrite (code no_match)Blackholes.Preview, Blackholes.Execute

StatusLocked

WhenOperations
another process holds the lock after lock_timeoutOpen

StatusConflict

WhenOperations
an enabled plugin finds the database inconsistent with its copies: backups refuse diverging copies with code backup_history_divergent, naming themOpen
concurrent writes prevent the commitMutation.Run
an entity revision check fails or a concurrent writer prevents the commit; a revision mismatch reports the entity and expected and actual revisionsDatabase.MergePatch
the authored definition or accepted plan changed before the explicit control committedDatabase.Plan
another write committed to the database during the buildDatabase.BulkFinish
the plugin's write lost to a concurrent change, or the database holds writesDatabase.PluginCall
the database holds writesDatabase.PluginStream, PluginStream.Finish, Objects.Upload
the database holds writes while the plugin stores the bytesPluginStream.Write
a name is already taken in its parent or appears twice, or the database holds writesObjects.Create
expected_revision is stale, or the database holds writesObjects.Update, Objects.Remove
the name is occupied without replace, expected_revision is stale, or the database holds writesObjects.Move
the side already finished (code already_finished), or the other party's queue is full (code delivery_failed)Events.Send, Events.Finish
the definition, parameters, selection or history changed since the preview, or the digest names another requestBlackholes.Execute

StatusInvalidDefinition

WhenOperations
a schema cannot compile or a reference cannot resolveValidateSchema
the macro is invalid or expands recursivelyBuildMacro, ExpandMacro
the definition is invalidDatabase.Query, Database.Mutation
a macro it calls is invalid or expands recursivelyDatabase.Expression
the loaded query definition is invalidQuery.Run
the query or its callable definitions are invalidQuery.Subscribe
the mutation selection or definition is invalidMutation.Run
the patched definition is invalidDatabase.PatchDefinition

StatusSchemaViolation

WhenOperations
the selected instance does not match the schemaValidateSchema
the write breaks a schemaMutation.Run

StatusInvalidCommitTime

WhenOperations
the #_tx commit time is not later than the last commitDatabase.MergePatch

StatusClosed

Codes: closed.

WhenOperations
the database is closedDatabase.ReadEntity, Database.Query, Database.Mutation, Database.Expression, Database.MergePatch, Database.Definition, Database.Plan, Database.Definitions, Database.PatchDefinition, Database.IndexesSync, Database.BulkBegin, Database.BulkAdd, Database.BulkFinish, Database.PluginCall, Database.PluginStream, Objects.Get, Objects.Lookup, Objects.Children, Objects.Path, Objects.Files, Objects.Manifest, Objects.Create, Objects.Update, Objects.Move, Objects.Remove, Objects.Upload, Objects.Open, Reactors.Status, Events.Status, Events.OpenOwner, Events.CloseOwner, Events.Publish, Events.Subscribe, Events.Receive, Events.Unsubscribe, Events.Register, Events.Unregister, Events.Accept, Events.Call, Events.Send, Events.Finish, Events.Cancel, Events.Read, Blackholes.Preview, Blackholes.Execute, Blackholes.Audit, Blackholes.Status, Backups.Status, Backups.Sync, Sdk.Status, Sdk.Sync, Skills.Status, Skills.Sync
the document is closedDocument.Serialize, Document.ToValue, Document.Root, Document.Count, Document.Read, Document.ReadMany, Document.Member, Document.Pointer, Document.Children, Document.Members, Document.I64, Document.F64
the builder is closedBuilder.Add, Builder.AddMany, Builder.Seal
the program is closedProgram.Evaluate
the query is closedQuery.Run, Query.Subscribe
the rows is closedRows.Next, Rows.Pages, Rows.AllPages
the subscription is closedSubscription.Next
the mutation is closedMutation.Run
the plugin_stream is closedPluginStream.Write, PluginStream.Read, PluginStream.Seek, PluginStream.Finish

StatusRejected

WhenOperations
a mutation target or write guard refuses the writeMutation.Run
the database refuses the patch; the code and diagnostic path name the reason and keyDatabase.MergePatch
a validator of an enabled plugin refused the definition, such as an event definition outside a mode or with a schema that does not compileDatabase.PatchDefinition
the database refuses the patch; the build has failed and later adds report the same statusDatabase.BulkAdd
the database refuses a patch; an initial build publishes nothing and fallback keeps earlier commitsDatabase.BulkFinish

StatusUnsupported

Codes: abi_version, core_digest, unsupported_runtime, abi_layout, abi_symbol.

WhenOperations
found differs from the ABI version of the bindingCheckVersion
a selected plugin has no implementation on this platform: the filesystem plugin on WindowsOpen

StatusCancelled

Codes: cancelled.

WhenOperations
the subscription is cancelled or closedSubscription.Next

StatusTimeout

WhenOperations
max_wait passed firstDatabase.IndexesSync
the plugin's wait passed its limitDatabase.PluginCall
maxWait passed before an event arrivedEvents.Receive
maxWait passed before an exchange arrivedEvents.Accept
maxWait passed before a notice arrivedEvents.Read
maxWait passed before every target confirmedBackups.Sync
maxWait passed before the work finishedSdk.Sync, Skills.Sync

StatusUnavailable

WhenOperations
an enabled plugin cannot reach what the open needs: backups refuse with backup_targets_unreachable, backup_target_unreadable or backup_objects_required; filesystem refuses with filesystem_fuse_unavailable or filesystem_mount_failed, naming the mount point; the events plugin is required when the database stores event definitions (plugin_required)Open
the patch sets stardust/history and no enabled plugin purges historyMutation.Run, Database.MergePatch
the plugin is unknown or the database does not enable itDatabase.PluginCall, Database.PluginStream
the database does not enable the objects pluginObjects.Get, Objects.Lookup, Objects.Children, Objects.Path, Objects.Files, Objects.Manifest, Objects.Create, Objects.Update, Objects.Move, Objects.Remove, Objects.Upload, Objects.Open
the database does not enable the reactors pluginReactors.Status
the database does not enable the events pluginEvents.Status, Events.OpenOwner, Events.CloseOwner, Events.Publish, Events.Subscribe, Events.Receive, Events.Unsubscribe, Events.Register, Events.Unregister, Events.Accept, Events.Call, Events.Send, Events.Finish, Events.Cancel, Events.Read
the database does not enable the blackholes pluginBlackholes.Preview, Blackholes.Audit, Blackholes.Status
the database does not enable the blackholes plugin, an earlier execution is still recovering, an index covers a selected field and cannot be repaired, or a backup target cannot take the blackholeBlackholes.Execute
the database does not enable the backups pluginBackups.Status, Backups.Sync
the database does not enable the sdk pluginSdk.Status, Sdk.Sync
the database does not enable the skills pluginSkills.Status, Skills.Sync

StatusFailed

WhenOperations
a reactor fails; the initiating write and all derived changes are rolled backMutation.Run, Database.MergePatch
a reactor fails; the definition and all derived changes are rolled backDatabase.PatchDefinition
a reactor fails while committing this patch; earlier fallback patches remain committedDatabase.BulkAdd
a reactor failed while adding a fallback patch; earlier patches remain committedDatabase.BulkFinish
the plugin's work failedDatabase.PluginCall
the plugin's work failed; status describes the failureBackups.Sync, Sdk.Sync, Skills.Sync

StatusUnlicensed

Codes: unlicensed.

WhenOperations
the token is refused; the error names the reasonActivate

StatusInvalidPointer

WhenOperations
the text is not a JSON Pointer or the array is not a canonical path arrayDocument.Pointer
the text is not empty and does not start with /, or holds ~ not followed by 0 or 1pointer.Parse
a token is a negative or non-integral number, an index-shaped string such as "0", or neither a number nor a stringpointer.Format

Refusal examples

The generator captured each result from the native library.

Describe the backup runtime

go151 B
failed, err := db.Backups().Status()
if failed != nil {
	defer failed.Close()
}

var result *stardust.Error
if !errors.As(err, &result) {
	return err
}
TRON272 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00BBC 756E617661696C 61626C65txt "unavailable"
0170F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
0216C 656E74697479txt "entity"
02800nil
0290F 0A 21000000 2800 0000map leaf, size 10: @21 → @28
0337C 6D657373616765txt "message"
03B14 19 74686520706C 7567696E20697320 6E6F7420656E6162 6C6564txt "the plugin is not enable…"
0560F 0A 33000000 3B00 0000map leaf, size 10: @33 → @3B
06007 0E 08020000 2900 0000 56000000map branch, size 14, depth 1, slots 3, 9: @29 → @56
06E4C 70617468txt "path"
07300nil
0740F 0A 6E000000 7300 0000map leaf, size 10: @6E → @73
07EAC 76696F6C617469 6F6E73txt "violations"
08900nil
08A0F 0A 7E000000 8900 0000map leaf, size 10: @7E → @89
0945C 6669656C64txt "field"
09A00nil
09B0F 0A 94000000 9A00 0000map leaf, size 10: @94 → @9A
0A507 0E 00090000 8A00 0000 9B000000map branch, size 14, depth 2, slots 8, 11: @8A → @9B
0B307 0A 02000000 A500 0000map branch, size 10, depth 1, slots 1: @A5
0BD4C 636F6465txt "code"
0C2BC 756E617661696C 61626C65txt "unavailable"
0CE0F 0A BD000000 C200 0000map leaf, size 10: @BD → @C2
0D86C 6F6666736574txt "offset"
0DF00nil
0E00F 0A D8000000 DF00 0000map leaf, size 10: @D8 → @DF
0EA07 1E 51620000 1700 0000 60000000 7400 0000 B3000000 CE00 0000 E0000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @17 → @60 → @74 → @B3 → @CE → @E0

Wait until every target stored the history

go246 B
syncOptions, err := stardust.Parse([]byte(`{maxWait {#dur PT5S}}`), stardust.DUST)
if err != nil {
	return err
}
defer syncOptions.Close()
err = db.Backups().Sync(syncOptions)
var result *stardust.Error
if !errors.As(err, &result) {
	return err
}
TRON272 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00BBC 756E617661696C 61626C65txt "unavailable"
0170F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
0216C 656E74697479txt "entity"
02800nil
0290F 0A 21000000 2800 0000map leaf, size 10: @21 → @28
0337C 6D657373616765txt "message"
03B14 19 74686520706C 7567696E20697320 6E6F7420656E6162 6C6564txt "the plugin is not enable…"
0560F 0A 33000000 3B00 0000map leaf, size 10: @33 → @3B
06007 0E 08020000 2900 0000 56000000map branch, size 14, depth 1, slots 3, 9: @29 → @56
06E4C 70617468txt "path"
07300nil
0740F 0A 6E000000 7300 0000map leaf, size 10: @6E → @73
07EAC 76696F6C617469 6F6E73txt "violations"
08900nil
08A0F 0A 7E000000 8900 0000map leaf, size 10: @7E → @89
0945C 6669656C64txt "field"
09A00nil
09B0F 0A 94000000 9A00 0000map leaf, size 10: @94 → @9A
0A507 0E 00090000 8A00 0000 9B000000map branch, size 14, depth 2, slots 8, 11: @8A → @9B
0B307 0A 02000000 A500 0000map branch, size 10, depth 1, slots 1: @A5
0BD4C 636F6465txt "code"
0C2BC 756E617661696C 61626C65txt "unavailable"
0CE0F 0A BD000000 C200 0000map leaf, size 10: @BD → @C2
0D86C 6F6666736574txt "offset"
0DF00nil
0E00F 0A D8000000 DF00 0000map leaf, size 10: @D8 → @DF
0EA07 1E 51620000 1700 0000 60000000 7400 0000 B3000000 CE00 0000 E0000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @17 → @60 → @74 → @B3 → @CE → @E0

convert

duplicateText holds this document:

TRON24 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
04BC 7B3A612031203A 6120327Dtxt "{:a 1 :a 2}"
go339 B
source, err := stardust.Parse(duplicateText, stardust.TRON)
if err != nil {
	return err
}
defer source.Close()

root, err := source.Root()
if err != nil {
	return err
}
view, err := source.Read(root)
if err != nil {
	return err
}

failed, result := stardust.Parse([]byte(view.Text), stardust.EDN)
if failed != nil {
	defer failed.Close()
}
TRON300 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B14 10 696E76616C69 645F617267756D65 6E74txt "invalid_argument"
01D0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
0276C 656E74697479txt "entity"
02E00nil
02F0F 0A 27000000 2E00 0000map leaf, size 10: @27 → @2E
0397C 6D657373616765txt "message"
04114 27 696E76616C69 642045444E202844 75706C6963617465 5F4B657929206174 206F666673657420 36txt "invalid EDN (Duplicate_K…"
06A0F 0A 39000000 4100 0000map leaf, size 10: @39 → @41
07407 0E 08020000 2F00 0000 6A000000map branch, size 14, depth 1, slots 3, 9: @2F → @6A
0824C 70617468txt "path"
08700nil
0880F 0A 82000000 8700 0000map leaf, size 10: @82 → @87
092AC 76696F6C617469 6F6E73txt "violations"
09D00nil
09E0F 0A 92000000 9D00 0000map leaf, size 10: @92 → @9D
0A85C 6669656C64txt "field"
0AE00nil
0AF0F 0A A8000000 AE00 0000map leaf, size 10: @A8 → @AE
0B907 0E 00090000 9E00 0000 AF000000map branch, size 14, depth 2, slots 8, 11: @9E → @AF
0C707 0A 02000000 B900 0000map branch, size 10, depth 1, slots 1: @B9
0D14C 636F6465txt "code"
0D6BC 696E76616C6964 5F65646Etxt "invalid_edn"
0E20F 0A D1000000 D600 0000map leaf, size 10: @D1 → @D6
0EC6C 6F6666736574txt "offset"
0F302 06000000000000 00i64 6
0FC0F 0A EC000000 F300 0000map leaf, size 10: @EC → @F3
10607 1E 51620000 1D00 0000 74000000 8800 0000 C7000000 E200 0000 FC000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @1D → @74 → @88 → @C7 → @E2 → @FC

Refuse a metadata-only transaction

patchText holds this document:

TRON46 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 617574686F72txt "author"
0B1C 78txt "x"
0D0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
174C 235F7478txt "#_tx"
1C0F 0A 17000000 0D00 0000map leaf, size 10: @17 → @D
go144 B
patch, err := stardust.Parse(patchText, stardust.TRON)
if err != nil {
	return err
}
defer patch.Close()

_, result := db.MergePatch(patch, nil)
TRON309 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B8C 72656A65637465 64txt "rejected"
0140F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
01E6C 656E74697479txt "entity"
02500nil
0260F 0A 1E000000 2500 0000map leaf, size 10: @1E → @25
0307C 6D657373616765txt "message"
03814 37 612070617463 68206F66206F6E6C 7920235F74782069 7320726566757365 643A20235F747820 616E6E6F74617465 7320612077726974 65txt "a patch of only #_tx is …"
0710F 0A 30000000 3800 0000map leaf, size 10: @30 → @38
07B07 0E 08020000 2600 0000 71000000map branch, size 14, depth 1, slots 3, 9: @26 → @71
0894C 70617468txt "path"
08E4C 235F7478txt "#_tx"
0930F 0A 89000000 8E00 0000map leaf, size 10: @89 → @8E
09DAC 76696F6C617469 6F6E73txt "violations"
0A800nil
0A90F 0A 9D000000 A800 0000map leaf, size 10: @9D → @A8
0B35C 6669656C64txt "field"
0B900nil
0BA0F 0A B3000000 B900 0000map leaf, size 10: @B3 → @B9
0C407 0E 00090000 A900 0000 BA000000map branch, size 14, depth 2, slots 8, 11: @A9 → @BA
0D207 0A 02000000 C400 0000map branch, size 10, depth 1, slots 1: @C4
0DC4C 636F6465txt "code"
0E114 10 7472616E7361 6374696F6E5F6F6E 6C79txt "transaction_only"
0F30F 0A DC000000 E100 0000map leaf, size 10: @DC → @E1
0FD6C 6F6666736574txt "offset"
10400nil
1050F 0A FD000000 0401 0000map leaf, size 10: @FD → @104
10F07 1E 51620000 1400 0000 7B000000 9300 0000 D2000000 F300 0000 05010000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @14 → @7B → @93 → @D2 → @F3 → @105

Refuse a repeated commit time

futureText holds this document:

TRON145 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
041C 78txt "x"
0602 01000000000000 00i64 1
0F0F 0A 04000000 0600 0000map leaf, size 10: @4 → @6
194C 23757463txt "#utc"
1E14 14 323230302D30 312D30315430303A 30303A30305Atxt "2200-01-01T00:00:00Z"
340F 0A 19000000 1E00 0000map leaf, size 10: @19 → @1E
3E14 14 737461726475 73742F636F6D6D69 747465644174txt "stardust/committedAt"
540F 0A 3E000000 3400 0000map leaf, size 10: @3E → @34
5E4C 235F7478txt "#_tx"
630F 0A 5E000000 5400 0000map leaf, size 10: @5E → @54
6D3C 235F64txt "#_d"
710F 0A 6D000000 0F00 0000map leaf, size 10: @6D → @F
7B07 0E 08010000 6300 0000 71000000map branch, size 14, depth 0 (root), slots 3, 8: @63 → @71

patchText holds this document:

TRON145 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
041C 78txt "x"
0602 02000000000000 00i64 2
0F0F 0A 04000000 0600 0000map leaf, size 10: @4 → @6
194C 23757463txt "#utc"
1E14 14 323230302D30 312D30315430303A 30303A30305Atxt "2200-01-01T00:00:00Z"
340F 0A 19000000 1E00 0000map leaf, size 10: @19 → @1E
3E14 14 737461726475 73742F636F6D6D69 747465644174txt "stardust/committedAt"
540F 0A 3E000000 3400 0000map leaf, size 10: @3E → @34
5E4C 235F7478txt "#_tx"
630F 0A 5E000000 5400 0000map leaf, size 10: @5E → @54
6D3C 235F65txt "#_e"
710F 0A 6D000000 0F00 0000map leaf, size 10: @6D → @F
7B07 0E 08010000 6300 0000 71000000map branch, size 14, depth 0 (root), slots 3, 8: @63 → @71
go322 B
future, err := stardust.Parse(futureText, stardust.TRON)
if err != nil {
	return err
}
defer future.Close()

if _, err := db.MergePatch(future, nil); err != nil {
	return err
}

patch, err := stardust.Parse(patchText, stardust.TRON)
if err != nil {
	return err
}
defer patch.Close()

_, result := db.MergePatch(patch, nil)
TRON336 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B14 13 696E76616C69 645F636F6D6D6974 5F74696D65txt "invalid_commit_time"
0200F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
02A6C 656E74697479txt "entity"
03100nil
0320F 0A 2A000000 3100 0000map leaf, size 10: @2A → @31
03C7C 6D657373616765txt "message"
04414 47 737461726475 73742F636F6D6D69 747465644174206D 7573742062652073 74726963746C7920 6E65776572207468 616E20746865206C 617465737420636F 6D6D69742074696D 65txt "stardust/committedAt mus…"
08D0F 0A 3C000000 4400 0000map leaf, size 10: @3C → @44
09707 0E 08020000 3200 0000 8D000000map branch, size 14, depth 1, slots 3, 9: @32 → @8D
0A54C 70617468txt "path"
0AA00nil
0AB0F 0A A5000000 AA00 0000map leaf, size 10: @A5 → @AA
0B5AC 76696F6C617469 6F6E73txt "violations"
0C000nil
0C10F 0A B5000000 C000 0000map leaf, size 10: @B5 → @C0
0CB5C 6669656C64txt "field"
0D100nil
0D20F 0A CB000000 D100 0000map leaf, size 10: @CB → @D1
0DC07 0E 00090000 C100 0000 D2000000map branch, size 14, depth 2, slots 8, 11: @C1 → @D2
0EA07 0A 02000000 DC00 0000map branch, size 10, depth 1, slots 1: @DC
0F44C 636F6465txt "code"
0F914 13 696E76616C69 645F636F6D6D6974 5F74696D65txt "invalid_commit_time"
10E0F 0A F4000000 F900 0000map leaf, size 10: @F4 → @F9
1186C 6F6666736574txt "offset"
11F00nil
1200F 0A 18010000 1F01 0000map leaf, size 10: @118 → @11F
12A07 1E 51620000 2000 0000 97000000 AB00 0000 EA000000 0E01 0000 20010000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @20 → @97 → @AB → @EA → @10E → @120

Refuse an invalid query definition

queryText holds this document:

TRON43 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
042C 3F78txt "?x"
070E 0D 00 0100 010000 00 04000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4
144C 66696E64txt "find"
190F 0A 14000000 0700 0000map leaf, size 10: @14 → @7
go194 B
definition, err := stardust.Parse(queryText, stardust.TRON)
if err != nil {
	return err
}
defer definition.Close()

query, result := db.Query(definition)
if query != nil {
	defer query.Close()
}
TRON277 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B14 12 696E76616C69 645F646566696E69 74696F6Etxt "invalid_definition"
01F0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
0296C 656E74697479txt "entity"
03000nil
0310F 0A 29000000 3000 0000map leaf, size 10: @29 → @30
03B7C 6D657373616765txt "message"
04314 10 556E626F756E 645F566172696162 6C65txt "Unbound_Variable"
0550F 0A 3B000000 4300 0000map leaf, size 10: @3B → @43
05F07 0E 08020000 3100 0000 55000000map branch, size 14, depth 1, slots 3, 9: @31 → @55
06D4C 70617468txt "path"
07200nil
0730F 0A 6D000000 7200 0000map leaf, size 10: @6D → @72
07DAC 76696F6C617469 6F6E73txt "violations"
08800nil
0890F 0A 7D000000 8800 0000map leaf, size 10: @7D → @88
0935C 6669656C64txt "field"
09900nil
09A0F 0A 93000000 9900 0000map leaf, size 10: @93 → @99
0A407 0E 00090000 8900 0000 9A000000map branch, size 14, depth 2, slots 8, 11: @89 → @9A
0B207 0A 02000000 A400 0000map branch, size 10, depth 1, slots 1: @A4
0BC4C 636F6465txt "code"
0C114 10 756E626F756E 645F766172696162 6C65txt "unbound_variable"
0D30F 0A BC000000 C100 0000map leaf, size 10: @BC → @C1
0DD6C 6F6666736574txt "offset"
0E400nil
0E50F 0A DD000000 E400 0000map leaf, size 10: @DD → @E4
0EF07 1E 51620000 1F00 0000 5F000000 7300 0000 B2000000 D300 0000 E5000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @1F → @5F → @73 → @B2 → @D3 → @E5

Report a missing stored query

go88 B
query, result := db.QueryPath("people/missing")
if query != nil {
	defer query.Close()
}
TRON283 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B9C 6E6F745F666F75 6E64txt "not_found"
0150F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
01F6C 656E74697479txt "entity"
02600nil
0270F 0A 1F000000 2600 0000map leaf, size 10: @1F → @26
0317C 6D657373616765txt "message"
03914 1A 6E6F20646566 696E6974696F6E20 6174207468697320 70617468txt "no definition at this pa…"
0550F 0A 31000000 3900 0000map leaf, size 10: @31 → @39
05F07 0E 08020000 2700 0000 55000000map branch, size 14, depth 1, slots 3, 9: @27 → @55
06D4C 70617468txt "path"
072EC 70656F706C652F 6D697373696E67txt "people/missing"
0810F 0A 6D000000 7200 0000map leaf, size 10: @6D → @72
08BAC 76696F6C617469 6F6E73txt "violations"
09600nil
0970F 0A 8B000000 9600 0000map leaf, size 10: @8B → @96
0A15C 6669656C64txt "field"
0A700nil
0A80F 0A A1000000 A700 0000map leaf, size 10: @A1 → @A7
0B207 0E 00090000 9700 0000 A8000000map branch, size 14, depth 2, slots 8, 11: @97 → @A8
0C007 0A 02000000 B200 0000map branch, size 10, depth 1, slots 1: @B2
0CA4C 636F6465txt "code"
0CF9C 6E6F745F666F75 6E64txt "not_found"
0D90F 0A CA000000 CF00 0000map leaf, size 10: @CA → @CF
0E36C 6F6666736574txt "offset"
0EA00nil
0EB0F 0A E3000000 EA00 0000map leaf, size 10: @E3 → @EA
0F507 1E 51620000 1500 0000 5F000000 8100 0000 C0000000 D900 0000 EB000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @15 → @5F → @81 → @C0 → @D9 → @EB

Report a malformed byte at offset zero

malformedText holds these bytes:

text1 B
]
go105 B
failed, result := stardust.Parse(malformedText, stardust.DUST)
if failed != nil {
	defer failed.Close()
}
TRON288 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B14 10 696E76616C69 645F617267756D65 6E74txt "invalid_argument"
01D0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
0276C 656E74697479txt "entity"
02E00nil
02F0F 0A 27000000 2E00 0000map leaf, size 10: @27 → @2E
0397C 6D657373616765txt "message"
04114 1A 496E76616C69 645F53796E746178 206174206F666673 65742030txt "Invalid_Syntax at offset…"
05D0F 0A 39000000 4100 0000map leaf, size 10: @39 → @41
06707 0E 08020000 2F00 0000 5D000000map branch, size 14, depth 1, slots 3, 9: @2F → @5D
0754C 70617468txt "path"
07A00nil
07B0F 0A 75000000 7A00 0000map leaf, size 10: @75 → @7A
085AC 76696F6C617469 6F6E73txt "violations"
09000nil
0910F 0A 85000000 9000 0000map leaf, size 10: @85 → @90
09B5C 6669656C64txt "field"
0A100nil
0A20F 0A 9B000000 A100 0000map leaf, size 10: @9B → @A1
0AC07 0E 00090000 9100 0000 A2000000map branch, size 14, depth 2, slots 8, 11: @91 → @A2
0BA07 0A 02000000 AC00 0000map branch, size 10, depth 1, slots 1: @AC
0C44C 636F6465txt "code"
0C9CC 696E76616C6964 5F64757374txt "invalid_dust"
0D60F 0A C4000000 C900 0000map leaf, size 10: @C4 → @C9
0E06C 6F6666736574txt "offset"
0E702 00000000000000 00i64 0
0F00F 0A E0000000 E700 0000map leaf, size 10: @E0 → @E7
0FA07 1E 51620000 1D00 0000 67000000 7B00 0000 BA000000 D600 0000 F0000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @1D → @67 → @7B → @BA → @D6 → @F0

Report malformed DUST

malformedText holds these bytes:

text1 B
[
go174 B
failed, err := stardust.Parse(malformedText, stardust.DUST)
if failed != nil {
	defer failed.Close()
}

var result *stardust.Error
if !errors.As(err, &result) {
	return err
}
TRON288 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B14 10 696E76616C69 645F617267756D65 6E74txt "invalid_argument"
01D0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
0276C 656E74697479txt "entity"
02E00nil
02F0F 0A 27000000 2E00 0000map leaf, size 10: @27 → @2E
0397C 6D657373616765txt "message"
04114 1A 556E65787065 637465645F456E64 206174206F666673 65742032txt "Unexpected_End at offset…"
05D0F 0A 39000000 4100 0000map leaf, size 10: @39 → @41
06707 0E 08020000 2F00 0000 5D000000map branch, size 14, depth 1, slots 3, 9: @2F → @5D
0754C 70617468txt "path"
07A00nil
07B0F 0A 75000000 7A00 0000map leaf, size 10: @75 → @7A
085AC 76696F6C617469 6F6E73txt "violations"
09000nil
0910F 0A 85000000 9000 0000map leaf, size 10: @85 → @90
09B5C 6669656C64txt "field"
0A100nil
0A20F 0A 9B000000 A100 0000map leaf, size 10: @9B → @A1
0AC07 0E 00090000 9100 0000 A2000000map branch, size 14, depth 2, slots 8, 11: @91 → @A2
0BA07 0A 02000000 AC00 0000map branch, size 10, depth 1, slots 1: @AC
0C44C 636F6465txt "code"
0C9CC 696E76616C6964 5F64757374txt "invalid_dust"
0D60F 0A C4000000 C900 0000map leaf, size 10: @C4 → @C9
0E06C 6F6666736574txt "offset"
0E702 02000000000000 00i64 2
0F00F 0A E0000000 E700 0000map leaf, size 10: @E0 → @E7
0FA07 1E 51620000 1D00 0000 67000000 7B00 0000 BA000000 D600 0000 F0000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @1D → @67 → @7B → @BA → @D6 → @F0

Refuse a positive sub-tick duration

boundaryText holds this document:

TRON21 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
0402 63000000000000 00i64 99

queryText holds this document:

TRON165 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
045C 3F6E616D65txt "?name"
0A0E 0D 00 0100 010000 00 04000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4
172C 3F65txt "?e"
1A4C 6E616D65txt "name"
1F5C 3F6E616D65txt "?name"
250E 15 00 0700 030000 00 17000000 1A0000 00 1F000000array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @17 → @1A → @1F
3A0E 0D 00 0100 010000 00 25000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @25
475C 3F6E616D65txt "?name"
4D0E 0D 00 0100 010000 00 47000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @47
5A5C 7768657265txt "where"
600F 0A 5A000000 3A00 0000map leaf, size 10: @5A → @3A
6A4C 66696E64txt "find"
6F0F 0A 6A000000 0A00 0000map leaf, size 10: @6A → @A
797C 6F726465724279txt "orderBy"
810F 0A 79000000 4D00 0000map leaf, size 10: @79 → @4D
8B07 12 2A000000 6000 0000 6F000000 8100 0000map branch, size 18, depth 0 (root), slots 1, 3, 5: @60 → @6F → @81
go676 B
definition, err := stardust.Parse(queryText, stardust.TRON)
if err != nil {
	return err
}
defer definition.Close()

query, err := db.Query(definition)
if err != nil {
	return err
}
defer query.Close()

boundary, err := stardust.Parse(boundaryText, stardust.TRON)
if err != nil {
	return err
}
defer boundary.Close()

boundaryRoot, err := boundary.Root()
if err != nil {
	return err
}
nanoseconds, err := boundary.I64(boundaryRoot)
if err != nil {
	return err
}

rows, err := query.Run(nil, stardust.RunOptions{PageSize: 2, MaxCost: time.Duration(nanoseconds)}, nil)
if rows != nil {
	defer rows.Close()
}

var result *stardust.Error
if !errors.As(err, &result) {
	return err
}
TRON341 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B14 10 696E76616C69 645F617267756D65 6E74txt "invalid_argument"
01D0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
0276C 656E74697479txt "entity"
02E00nil
02F0F 0A 27000000 2E00 0000map leaf, size 10: @27 → @2E
0397C 6D657373616765txt "message"
04114 55 546865206E75 6D62657220686173 206E6F2065786163 7420666F726D2069 6E20746865207461 7267657420747970 653A206475726174 696F6E2072657175 697265732077686F 6C6520313030206E 73207469636B73txt "The number has no exact …"
0980F 0A 39000000 4100 0000map leaf, size 10: @39 → @41
0A207 0E 08020000 2F00 0000 98000000map branch, size 14, depth 1, slots 3, 9: @2F → @98
0B04C 70617468txt "path"
0B500nil
0B60F 0A B0000000 B500 0000map leaf, size 10: @B0 → @B5
0C0AC 76696F6C617469 6F6E73txt "violations"
0CB00nil
0CC0F 0A C0000000 CB00 0000map leaf, size 10: @C0 → @CB
0D65C 6669656C64txt "field"
0DC00nil
0DD0F 0A D6000000 DC00 0000map leaf, size 10: @D6 → @DC
0E707 0E 00090000 CC00 0000 DD000000map branch, size 14, depth 2, slots 8, 11: @CC → @DD
0F507 0A 02000000 E700 0000map branch, size 10, depth 1, slots 1: @E7
0FF4C 636F6465txt "code"
104EC 696E6578616374 5F6E756D626572txt "inexact_number"
1130F 0A FF000000 0401 0000map leaf, size 10: @FF → @104
11D6C 6F6666736574txt "offset"
12400nil
1250F 0A 1D010000 2401 0000map leaf, size 10: @11D → @124
12F07 1E 51620000 1D00 0000 A2000000 B600 0000 F5000000 1301 0000 25010000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @1D → @A2 → @B6 → @F5 → @113 → @125