Skip to main content

sql_orm_sqlserver/
lib.rs

1//! SQL Server compilation layer.
2
3mod compiler;
4mod migration;
5mod quoting;
6
7use sql_orm_core::CrateIdentity;
8
9/// Placeholder compiler marker for the SQL Server dialect.
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11pub struct SqlServerCompiler;
12
13pub use quoting::{
14    quote_column_ref, quote_identifier, quote_qualified_identifier, quote_table_ref,
15};
16
17pub const CRATE_IDENTITY: CrateIdentity = CrateIdentity {
18    name: "sql-orm-sqlserver",
19    responsibility: "AST compilation and SQL Server specific quoting and SQL emission",
20};
21
22#[cfg(test)]
23mod tests {
24    use super::{CRATE_IDENTITY, SqlServerCompiler, quote_identifier};
25
26    #[test]
27    fn declares_sqlserver_compilation_boundary() {
28        let compiler = SqlServerCompiler;
29        assert_eq!(compiler, SqlServerCompiler);
30        assert!(CRATE_IDENTITY.responsibility.contains("SQL emission"));
31    }
32
33    #[test]
34    fn reexports_identifier_quoting() {
35        assert_eq!(quote_identifier("users").unwrap(), "[users]");
36    }
37}