public interface DbConfig
.dbconfig file,
or at runtime if the config is provided from a DbConfigProvider SPI implementation, it is obtained programmatically.
At compile-time the dbconfig is supplied as a resource file.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_SCHEMA_PKG |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBuildUrl()
(Optional) JDBC URL for database (build time).
|
default java.lang.String |
getBuildUrlOtherwiseRuntimeUrl()
Returns the build URL if provided, otherwise the runtime URL
|
java.lang.String |
getCatalogName()
(Optional) The catalog containing the schema.
|
java.lang.String |
getCustomBaseClass()
(Optional) The qualified name of the base class to be used for generated schema table classes
|
java.lang.String |
getCustomBaseInterface()
(Optional) The qualified name of the base interface to be used for generated schema table classes
|
java.lang.String |
getDbDdl()
(Optional) The DDL for the database/schema this configuration is using.
|
java.lang.String |
getName()
(Provided) Name corresponding with the dbconfig file: MyDatabase.dbconfig -> "MyDatabase".
|
java.lang.String |
getPassword()
(Optional) Password for database account
|
java.lang.String |
getPath()
(Provided: Compile) Location of dbconfig file corresponding with this class.
|
manifold.rt.api.Bindings |
getProperties()
(Optional) JDBC connection properties in JSON format.
|
java.lang.String |
getSchemaName()
(Optional) The name of the database schema used for this configuration.
|
java.lang.String |
getSchemaPackage()
(Optional) The fully qualified package name where schema .class files will be generated.
|
java.lang.String |
getUrl()
(Required: Compile/Run) JDBC URL for database (run time).
|
java.lang.String |
getUser()
(Optional) Username for database account
|
void |
init(java.sql.Connection connection,
ExecutionEnv environment) |
boolean |
isDefault()
(Optional) If true, this dbconfig is the "default" configuration.
|
boolean |
isInMemory()
(Optional) true if using the database and driver in-process (in-memory) e.g., jdbc:h2:mem or jdbc:sqlite::memory:.
|
default java.util.Properties |
toProperties()
Convert the connection related config attributes to a Properties object
|
static final java.lang.String DEFAULT_SCHEMA_PKG
java.lang.String getName()
DbConfigProvider
SPI, it will be supplied by the implementation.java.lang.String getCatalogName()
"", this indicates only schemas without a catalog will be considered.
Note, it is common for JDBC drivers to support naming the catalog in the URL. In this case the catalog name is unnecessary
in the dbconfig.
Note, some drivers provide schema names as catalog names i.e., catalogs without schemas. For instance, MySql does this.
In this case the catalog names are queried from the database metadata, but used as schema names. Do not provide the
catalog name if it is not the container of the schema.java.lang.String getSchemaName()
java.lang.String getPath()
java.lang.String getUrl()
getBuildUrl() returns null, this URL is used
both for runtime and build time.java.lang.String getBuildUrl()
java.lang.String getSchemaPackage()
DEFAULT_SCHEMA_PKG.
This property is used exclusively for compile time.java.lang.String getUser()
java.lang.String getPassword()
boolean isDefault()
MyQueryFile.MyDbConfig.sql"[.sql:MyDbConfig/] select * from ..."
"[MyQuery.sql:MyDbConfig/] select * from ..."manifold.rt.api.Bindings getProperties()
toProperties().java.lang.String getDbDdl()
java.lang.String getCustomBaseInterface()
java.lang.String getCustomBaseClass()
boolean isInMemory()
default java.lang.String getBuildUrlOtherwiseRuntimeUrl()
default java.util.Properties toProperties()
void init(java.sql.Connection connection,
ExecutionEnv environment)
throws java.sql.SQLException
java.sql.SQLExceptionCopyright © 2024. All rights reserved.