Registering JDBC Driversĭrivers that use a JDBC driver under the hood will need to add a register-jdbc-driver step as well. If your driver’s method implementations are split across multiple namespaces, make sure they’ll get loaded as well – you can either have the main namespace handle this (e.g., by including them in the :require form in the namespace declaration) or by adding additional load-namespace steps.įor some background on namespaces, see Clojure namespaces. load-namespace calls require the normal Clojure way, meaning it will load other namespaces listed in the :require section of its namespace declaration as needed. You’ll need to add one or more load-namespace steps to your driver manifest to tell Metabase which namespaces contain your driver method implementations. Init : - step : load-namespace namespace : - step : register-jdbc-driver class : Loading namespaces In the example manifest above, there are two steps, a load-namespace step, and a register-jdbc-driver step: Initialization goes something like this: Metabase adds the driver to the classpath, then it performs each init section of the plugin manifest, in order. Metabase will initialize plugins automatically as needed. You can (but shouldn’t) set a driver to lazy-load: false, as this will make Metabase take longer to launch and eat up more memory. The driver in the example above is listed as lazy-load: true, which means that, while the method implementation mentioned above are created when Metabase launches, Metabase won’t initialize the driver until the first time someone attempts to connect to a database that uses that driver. The plugin also lists the display name and connection properties for the driver, which Metabase’s plugin system uses to creates implementations for driver/display-name and driver/connection-properties. Metabase’s plugin system uses these details to call driver/register!. The driver section tells Metabase that the plugin defines a driver named :sqlite that has :sql-jdbc as a parent. contact-info : name : Toucan McBird address : driver : name : sqlite display-name : SQLite lazy-load : true parent : sql-jdbc connection-properties : - name : db display-name : Filename placeholder : /home/camsaul/toucan_sightings.sqlite required : true init : - step : load-namespace namespace : - step : register-jdbc-driver class : The error is not present in the build log.Info : name : Metabase SQLite Driver version : 1.0.0-SNAPSHOT-3.25.2 description : Allows Metabase to connect to SQLite databases. INFO | jvm 1 | 4 08:53:50 | 08:53:50,241 ERROR Unexpected HTTP status code: HTTP/1.1 413 Request Entity Too Large INFO | jvm 1 | 4 08:53:50 | 08:53:50,240 INFO Finished writing the artifact to the output stream, time elapsed: 3.994 s INFO | jvm 1 | 4 08:53:46 | 08:53:46,213 INFO Trying to publish the artifact with handler: .artifact.BambooRemoteArtifactHandler INFO | jvm 1 | 4 08:53:46 | 08:53:46,212 INFO Publishing for PROJ-PLAN-JOB-#: 1 file(s) matching in directory /home/bamboo/bamboo-agent-home/xml-data/build-dir/PROJ-PLAN-JOB
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |