feat(uxdb): add UXDB database support
This commit is contained in:
65 files changed
+697
-96
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package com.dbx.agent.uxdb;
|
||||
|
||||
import com.dbx.agent.MultiSessionJsonRpcServer;
|
||||
import com.dbx.agent.PostgresLikeAgent;
|
||||
import com.dbx.agent.PostgresLikeAgentProfile;
|
||||
|
||||
public final class UxdbAgent extends PostgresLikeAgent {
|
||||
public static final PostgresLikeAgentProfile UXDB_PROFILE = new PostgresLikeAgentProfile(
|
||||
"com.uxsino.uxdb.Driver",
|
||||
"jdbc:uxdb://{host}:{port}/{database}",
|
||||
52025,
|
||||
"ux_catalog",
|
||||
"ux_"
|
||||
);
|
||||
|
||||
public UxdbAgent() {
|
||||
super(UXDB_PROFILE);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new MultiSessionJsonRpcServer(UxdbAgent::new).run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.dbx.agent.uxdb;
|
||||
|
||||
import com.dbx.agent.ConnectParams;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
class UxdbAgentTest {
|
||||
@Test
|
||||
void profileUsesOfficialJdbcSettings() {
|
||||
assertEquals("com.uxsino.uxdb.Driver", UxdbAgent.UXDB_PROFILE.getDriverClass());
|
||||
assertEquals("ux_catalog", UxdbAgent.UXDB_PROFILE.getCatalogSchema());
|
||||
assertEquals("ux_catalog.ux_database", UxdbAgent.UXDB_PROFILE.catalogRelation("database"));
|
||||
assertEquals(
|
||||
"jdbc:uxdb://localhost:52025/uxdb",
|
||||
UxdbAgent.UXDB_PROFILE.buildUrl(new ConnectParams("localhost", 0, "uxdb", "uxdb", "", "", "", false))
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void usesPostgresStyleSchemaSearchPath() {
|
||||
assertEquals("SET search_path TO \"public\"", new UxdbAgent().setSchemaSQL("public"));
|
||||
assertEquals("RESET search_path", new UxdbAgent().resetSchemaSQL());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user