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

Function table_names

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

Names of every registered table.

()

Source from the content-addressed store, hash-verified

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