fix(dbx-core): preserve mysql cross-database targets

This commit is contained in:
Fody Jute authored and GitHub committed 2026-07-04 00:58:52 +08:00
1 parent 570230e525
commit 2225343e8a
6 files changed
+197 -27

No files matched your search

@@ -218,7 +218,7 @@ pub(in crate::schema) async fn table_ddl(
table: &str,
) -> Result<String, String> {
match pool {
PoolKind::Mysql(p, _) => super::super::mysql_ddl(p, table).await,
PoolKind::Mysql(p, _) => super::super::mysql_ddl(p, schema, table).await,
PoolKind::Postgres(p) if config.is_some_and(is_opengauss_family_config) => {
match super::super::opengauss_table_ddl(p, schema, table).await {
Ok(ddl) => Ok(ddl),
@@ -247,7 +247,14 @@ pub(in crate::schema) async fn object_source(
object_type: &db::ObjectSourceKind,
) -> Result<Option<String>, String> {
match pool {
PoolKind::Mysql(pool, _) => super::super::mysql_object_source(pool, name, object_type).await.map(Some),
PoolKind::Mysql(pool, _) => super::super::mysql_object_source(
pool,
super::super::mysql_table_metadata_catalog(database, schema),
name,
object_type,
)
.await
.map(Some),
PoolKind::Postgres(pool) => {
super::super::postgres_object_source(pool, schema, name, object_type).await.map(Some)
}