use crate::errors::ExecutorError;
pub(super) fn version(
args: &[vibesql_types::SqlValue],
) -> Result<vibesql_types::SqlValue, ExecutorError> {
if !args.is_empty() {
return Err(ExecutorError::UnsupportedFeature("VERSION takes no arguments".to_string()));
}
let version = env!("CARGO_PKG_VERSION");
Ok(vibesql_types::SqlValue::Varchar(arcstr::ArcStr::from(format!("NistMemSQL {}", version))))
}
pub(super) fn database(
args: &[vibesql_types::SqlValue],
name: &str,
) -> Result<vibesql_types::SqlValue, ExecutorError> {
if !args.is_empty() {
return Err(ExecutorError::UnsupportedFeature(format!("{} takes no arguments", name)));
}
Ok(vibesql_types::SqlValue::Varchar(arcstr::ArcStr::from("default")))
}
pub(super) fn user(
args: &[vibesql_types::SqlValue],
name: &str,
) -> Result<vibesql_types::SqlValue, ExecutorError> {
if !args.is_empty() {
return Err(ExecutorError::UnsupportedFeature(format!("{} takes no arguments", name)));
}
Ok(vibesql_types::SqlValue::Varchar(arcstr::ArcStr::from("anonymous")))
}