File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
crates/proof-of-sql/src/base/database Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ impl TableRef {
4848 }
4949 }
5050
51- /// Returns the identifier of the schema
52- /// # Panics
51+ /// Returns the identifier of the schema if it exists. Otherwise returns `None`.
5352 #[ must_use]
5453 pub fn schema_id ( & self ) -> Option < & Ident > {
5554 match self {
@@ -58,6 +57,17 @@ impl TableRef {
5857 }
5958 }
6059
60+ /// Returns the identifier of the table if it exists. Otherwise returns `None`.
61+ #[ must_use]
62+ pub fn table_id ( & self ) -> Option < & Ident > {
63+ match self {
64+ Self :: FullyQualified { table_name, .. } | Self :: TableOnly { table_name } => {
65+ Some ( table_name)
66+ }
67+ Self :: None => None ,
68+ }
69+ }
70+
6171 /// Creates a new table reference from an optional schema and table name.
6272 #[ must_use]
6373 pub fn from_names ( schema_name : Option < & str > , table_name : & str ) -> Self {
You can’t perform that action at this time.
0 commit comments