{"record":{"id":"556c8a3781aac7ea","repo":"SeaQL/sea-orm","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/database/statement.rs","lineNumber":112,"sourceCode":"        }\n    }\n}\n\nmacro_rules! build_any_stmt {\n    ($stmt: expr, $db_backend: expr) => {\n        match $db_backend {\n            DbBackend::MySql => $stmt.build(MysqlQueryBuilder),\n            DbBackend::Postgres => $stmt.build(PostgresQueryBuilder),\n            DbBackend::Sqlite => $stmt.build(SqliteQueryBuilder),\n        }\n    };\n}\n\nmacro_rules! build_postgres_stmt {\n    ($stmt: expr, $db_backend: expr) => {\n        match $db_backend {\n            DbBackend::Postgres => $stmt.to_string(PostgresQueryBuilder),\n            DbBackend::MySql | DbBackend::Sqlite => unimplemented!(),\n        }\n    };\n}\n\nmacro_rules! build_query_stmt {\n    ($stmt: ty) => {\n        impl StatementBuilder for $stmt {\n            fn build(&self, db_backend: &DbBackend) -> Statement {\n                let stmt = build_any_stmt!(self, db_backend);\n                Statement::from_string_values_tuple(*db_backend, stmt)\n            }\n\n            #[cfg(feature = \"rbac\")]\n            fn audit(&self) -> Result<QueryAccessAudit, AuditError> {\n                AuditTrait::audit(self)\n            }\n        }\n    };","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/SeaQL/sea-orm/blob/e29bcd1b417c41a553b386fe94511d7c64a1c8ec/src/database/statement.rs#L94-L130","documentation":"build_postgres_stmt! in src/database/statement.rs only renders its statement with the Postgres query builder; for DbBackend::MySql or Sqlite it calls unimplemented!(). The statement types registered with this macro have no SQL rendering for those backends.","triggerScenarios":"Building (calling .to_string()/build on) a statement whose type is compiled via build_postgres_stmt! while the connection backend is DbBackend::MySql or DbBackend::Sqlite.","commonSituations":"Using Postgres-only statement types while connected to MySQL or SQLite; sharing statement-building code across backends without a backend check.","solutions":["Use the statement only with a Postgres backend; check DbBackend before building","Use a portable sea_query statement/builder variant for MySQL/SQLite","Split backend-specific code paths so the wrong backend never reaches this statement"],"exampleFix":"// before\nlet sql = pg_only_stmt.to_string(&db_backend)?; // panics on MySql/Sqlite\n// after\nassert_eq!(db_backend, DbBackend::Postgres);\nlet sql = pg_only_stmt.to_string(PostgresQueryBuilder);","handlingStrategy":"validation","validationCode":"use sea_orm::DbBackend;\nfn backend_supported(b: &DbBackend) -> bool {\n    matches!(b, DbBackend::Postgres)\n}","typeGuard":"fn is_postgres(b: &DbBackend) -> bool { matches!(b, DbBackend::Postgres) }","tryCatchPattern":"// unimplemented!() panics; check backend first\nif is_postgres(&db_backend) { let sql = pg_only_stmt.to_string(&db_backend); } else { /* portable path */ }","preventionTips":["Check DbBackend before building backend-specific statements","Keep Postgres-only statements in Postgres-only code paths","Add debug_assert!(is_postgres(&backend)) near these builders"],"tags":["panic","unimplemented","postgres","backend"],"backgroundTag":"unsupported-platform","analyzedSha":"e29bcd1b417c41a553b386fe94511d7c64a1c8ec","analyzedAt":"2026-09-10T11:31:52.468Z","contentChangedAt":"2026-09-10T11:31:52.468Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}