#![no_std]
#![doc = include_str!("../README.md")]
extern crate alloc;
use alloc::string::String;
use thiserror::Error;
mod canonicalize;
pub use canonicalize::{Canonicalizer, hash_canonical};
#[derive(Clone, Debug, Error, Eq, PartialEq)]
#[non_exhaustive]
pub enum CanonicalizeError {
#[error("SQL parse error: {0}")]
Parse(String),
#[error("SQL input is longer than {limit} bytes")]
InputTooLong { limit: usize },
#[error("Expression nests deeper than {limit} levels")]
TooDeep { limit: usize },
#[error("Canonical text would not read back as itself: {0}")]
NotRoundTrippable(String),
#[error("Unsupported SQL: {0}")]
Unsupported(String),
}