MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / table_names

Function table_names

atomic-core/src/pristine/schema.rs:194–218  ·  view source on GitHub ↗

Names of every registered table.

()

Source from the content-addressed store, hash-verified

192
193/// Names of every registered table.
194pub(crate) fn table_names() -> Vec<String> {
195 struct Names(Vec<String>);
196
197 impl TableVisitor for Names {
198 fn table<K: Key + 'static, V: Value + 'static>(
199 &mut self,
200 definition: TableDefinition<'static, K, V>,
201 ) -> PristineResult<()> {
202 self.0.push(definition.name().to_string());
203 Ok(())
204 }
205
206 fn multimap<K: Key + 'static, V: Key + 'static>(
207 &mut self,
208 definition: MultimapTableDefinition<'static, K, V>,
209 ) -> PristineResult<()> {
210 self.0.push(definition.name().to_string());
211 Ok(())
212 }
213 }
214
215 let mut names = Names(Vec::new());
216 visit_tables(&mut names).expect("collecting table names cannot fail");
217 names.0
218}
219
220/// Record the baseline schema unless the database already carries a version.
221pub(crate) fn stamp_schema_version(txn: &WriteTransaction) -> PristineResult<()> {

Callers 4

merge_intoMethod · 0.85
verify_unchangedMethod · 0.85

Calls 2

NamesClass · 0.85
visit_tablesFunction · 0.85