{"record":{"id":"7c36d4a3bb34619f","repo":"clockworklabs/SpacetimeDB","slug":"datastore-clear-call-failed","errorCode":null,"errorMessage":"datastore_clear() call failed","messagePattern":"datastore_clear\\(\\) call failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bindings/src/table.rs","lineNumber":121,"sourceCode":"    fn delete(&self, row: Self::Row) -> bool {\n        // Note that as of writing deletion is infallible, but future work may define new constraints,\n        // e.g. foreign keys, which cause deletion to fail in some cases.\n        // If and when these new constraints are added,\n        // we should define `Self::ForeignKeyViolation`,\n        // analogous to [`Self::UniqueConstraintViolation`].\n\n        let relation = std::slice::from_ref(&row);\n        let buf = IterBuf::serialize(relation).unwrap();\n        let count = sys::datastore_delete_all_by_eq_bsatn(Self::table_id(), &buf).unwrap();\n        count > 0\n    }\n\n    /// Clears the table of all rows.\n    ///\n    /// Returns the number of rows that were deleted,\n    /// i.e., the value of [`self.count()`](Table::count) before this call.\n    fn clear(&self) -> u64 {\n        sys::datastore_clear(Self::table_id()).expect(\"datastore_clear() call failed\")\n    }\n\n    // Re-integrates the BSATN of the `generated_cols` into `row`.\n    #[doc(hidden)]\n    fn integrate_generated_columns(row: &mut Self::Row, generated_cols: &[u8]);\n}\n\n#[doc(hidden)]\n#[inline]\npub fn count<Tbl: Table>() -> u64 {\n    sys::datastore_table_row_count(Tbl::table_id()).expect(\"datastore_table_row_count() call failed\")\n}\n\n#[doc(hidden)]\npub trait TableInternal: Sized {\n    const TABLE_NAME: &'static str;\n    const TABLE_ACCESS: TableAccess = TableAccess::Private;\n    const UNIQUE_COLUMNS: &'static [u16];","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/bindings/src/table.rs#L103-L139","documentation":"Error \"datastore_clear() call failed\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/bindings/src/table.rs:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}