First, read through these:
Pay special attention to the “Developer Guide note” mentions in the Design Walkthrough to see how the design maps to the code.
Try out any of the unit tests and ITs in the DBMS-specific modules or the scenario test modules.
These will typically invoke deployments against actual DBs and vet that the results in the DB are correct.
You can use these to see the full code path executed and trace through as you need to.
Obevo defines a few common integation tests that DBMS implementations should use:
These tests require live DBs to execute against. In case you don’t already have databases to execute against and would like to develop, we have guidance on how to do so, whether via Amazon RDS or via installing express editions of the DBMS software.
See the table below for how to setup these dates.
Vendor | Test Locale |
---|---|
Sybase/SAP ASE | ASE Express Setup |
DB2 | Docker setup for DB2 Express |
MS SQL Server | Docker setup for SQL Server or Amazon RDS |
Oracle | Amazon RDS |
PostgreSQL | Docker setup for PostgreSQL or Amazon RDS |
Sybase/SAP IQ | No instructions available yet |
H2 | No setup needed (in-memory DB) |
HSQLDB | No setup needed (in-memory DB) |
You can use an existing DB implementation module as reference.
See the Platform Listing for the full list of modules.
We recommend obevo-db-postgresql as a default choice if you need a suggestion.
Rename only the package and the poms for now, i.e. don’t yet rename the classes; we will get to those later
Also add your project as a dependency to the obevo-db-client-all-dbs module.
Add entry to default.yaml in com.gs.obevo.db.confg in obevo-db
Rename platform name accordingly in <YourPlatform>DbPlatform
Option 1 (preferred): Docker search dockerhub for examples; you have plenty here
1) add setup-docker-mongodb.sh file. ensure that your db can start
2) add build profile to the pom
Option 2: Amazon RDS See CreateDbInstance for using an API to create your database The only database currently using this is the Redshift platform (currently housed in postgres) Your own method:
Obevo will run tests against actual DBMSs that have schemas dedicated to Obevo. Get a schema to facilitate your testing
As a convention, name your schemas as dbdeploy01, dbdeploy02, dbdeploymeta. * dbdeploy01 and dbdeploy02 are typically for testing your deployments * dbdeploymeta is for the metadata API tests
First, update the docker-*-creds.yaml file accordingly to the DB you just setup
Next, under platforms.<yourplatform>.example1.step1, let’s start simple with just the table (rename the other folders for now)
First, remove / comment the optional classes: * anything under change types * Lock classes * TranslationDialect classes
The main classes you will need to implement: * <PlatformName>DbPlatform * <PlatformName>AppContext * <PlatformName>EnvironmentInfraSetup * add code for programmatically creating schemas/groups/users, etc * <PlatformName>JdbcDataSourceFactory * add the semantics for generating jdbc urls * <PlatformName>SqlExecutor * here you will add the commands to switch between schemas
Also implement a DbMetadataDialect for your new implementation in obevo-db-metadata-manager-impl
Start w/ tables for now; we will get to stored procedures/views/etc. later
Follow the examples, e.g. PostgreSqlDeployerIT Most examples will have a “step1” and “step2” - the idea is to do the initial deployment and then a subsequent update so that you can vet both cases.
e.g. stored procedures, views, static data etc.
Also add the implementation for the DB Metadata Manager and the test
Note that some of the DBMS types require specific sqls to query out the db objects that schemacrawler cannot get to. This would be declared in the *AppContext class if applicable.