Skip to main content

table_name

Macro table_name 

Source
macro_rules! table_name {
    ($db:expr, $schema:expr, $table:expr) => { ... };
    ($schema:expr, $table:expr) => { ... };
    ($table:expr) => { ... };
}
Expand description

Creates a TableName with optional database and schema qualifiers.

This macro provides a convenient way to create table names with different levels of qualification. Returns a Result that must be handled with ? or .unwrap().

ยงExamples

use hyperdb_api::table_name;

// Simple table name
let table = table_name!("users")?;
assert_eq!(table.to_string(), "\"users\"");

// With schema
let table = table_name!("public", "users")?;
assert_eq!(table.to_string(), "\"public\".\"users\"");

// Fully qualified
let table = table_name!("mydb", "public", "users")?;
assert_eq!(table.to_string(), "\"mydb\".\"public\".\"users\"");