Expand description
DDL (Data Definition Language) syntax highlighting for schema output.
Provides syntax highlighting for CREATE TABLE, CREATE INDEX, ALTER TABLE, and other DDL statements with dialect-specific keyword support.
§Example
use sqlmodel_console::renderables::{DdlDisplay, SqlDialect};
use sqlmodel_console::Theme;
let ddl = "CREATE TABLE users (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
email TEXT UNIQUE
);";
let display = DdlDisplay::new(ddl)
.dialect(SqlDialect::PostgreSQL)
.line_numbers(true);
// Rich mode with syntax highlighting
println!("{}", display.render(80));
// Plain mode for agents
println!("{}", display.render_plain());Structs§
- Change
Region - A region of changed lines for diff highlighting.
- DdlDisplay
- DDL display for schema output with syntax highlighting.
Enums§
- Change
Kind - Kind of change for diff highlighting.
- SqlDialect
- SQL dialect for DDL generation.