diff --git a/schema-engine/sql-migration-tests/tests/initialization/mod.rs b/schema-engine/sql-migration-tests/tests/initialization/mod.rs index b19337ad3f34..81df714f445e 100644 --- a/schema-engine/sql-migration-tests/tests/initialization/mod.rs +++ b/schema-engine/sql-migration-tests/tests/initialization/mod.rs @@ -84,3 +84,28 @@ fn connecting_to_a_postgres_database_with_missing_schema_creates_it(api: TestApi assert!(schema_exists) } } + +#[test_connector(exclude(Sqlite))] +fn ipv6_addresses_are_supported_in_connection_strings(api: TestApi) { + let url = api.connection_string().replace("localhost", "[::1]"); + assert!(url.contains("[::1]")); + + let provider = api.provider(); + + let schema = format!( + r#" + datasource db {{ + provider = "{provider}" + url = "{url}" + }} + "# + ); + + let engine = schema_api(Some(schema.clone()), None).unwrap(); + tok( + engine.ensure_connection_validity(schema_core::json_rpc::types::EnsureConnectionValidityParams { + datasource: schema_core::json_rpc::types::DatasourceParam::SchemaString(SchemaContainer { schema }), + }), + ) + .unwrap(); +}