{"id":442,"date":"2019-07-17T10:55:54","date_gmt":"2019-07-17T10:55:54","guid":{"rendered":"http:\/\/www.hammerdb.com\/blog\/?p=442"},"modified":"2019-07-18T11:11:58","modified_gmt":"2019-07-18T11:11:58","slug":"how-to-add-your-database-to-hammerdb-pt1-opening-an-issue","status":"publish","type":"post","link":"https:\/\/www.hammerdb.com\/blog\/uncategorized\/how-to-add-your-database-to-hammerdb-pt1-opening-an-issue\/","title":{"rendered":"How to add your database to HammerDB &#8211; Pt1 Opening an issue"},"content":{"rendered":"\n<p>A very common request is for HammerDB to add support for a new database. Before reaching out with a request your first reference should be the <a href=\"https:\/\/db-engines.com\/en\/ranking\">DB-Engines Ranking<\/a>\u00a0 to gauge the relative popularity of a database.\u00a0 it is no coincidence that HammerDB supports the most popular databases with all of the databases currently supported being in the top 10 of this ranking.\u00a0 There may be compelling reasons to add a new database outside of the top 10 to HammerDB, however clearly the HammerDB developers cannot add and maintain support for them all. Therefore this series of posts explains how any contributor can add support for a new database in HammerDB.<\/p>\n<p>Firstly you will need both the source code from the <a href=\"https:\/\/github.com\/TPC-Council\/HammerDB\/\">HammerDB GitHub site<\/a>\u00a0 and<a href=\"https:\/\/www.hammerdb.com\/download.html\"> the binaries for your chosen platform<\/a> for testing.\u00a0\u00a0 Note that the key difference between the source code download and the binaries is the addition of the bin and lib directories in the binaries.\u00a0 Any changes that you make to the source download can be run on your chosen platform by adding these bin and lib directories to the source or functionally equivalent keeping the binary download as a test directory and copying the modified source here over the existing files to test any changes you have made.<\/p>\n<p>While on the subject of the lib directories one important aspect to consider before you begin making changes is the compiled library interface that you are going to use to communicate with your new database.\u00a0 Using MySQL as an example if you load the driver script you can see the following lines:<\/p>\n<pre>set library mysqltcl ;# MySQL Library<br \/>...if [catch {package require $library} message] { error \"Failed to load $library - $message\" }<\/pre>\n<p>The package require line loads the compiled library from the lib directory, in this case the library in the lib\/mysqltcl3.052 directory.\u00a0 Looking for example in this directory on Windows there is the file libmysqltcl.dll &#8211; opening this file in an application such as dependency walker shows that this file also requires the MySQL client library libmysql.dll.\u00a0 This library provides the interface between HammerDB and the TCL language it uses and the database provided client library.\u00a0 The source code for this interface is <a href=\"https:\/\/github.com\/xdobry\/mysqltcl\">here<\/a> and all intefaces used are open source and GPL compliant. (Note for clarity it is the TCL interface that must be open source rather than the database client library itself) Therefore you have a choice as to whether you use an existing interface already provided in HammerDB, an interface for your database already written that you will compile and put in your test lib directory, write a new interface or use the generic provided ODBC interface. If the later is a consideration then you should use the <a href=\"https:\/\/wiki.tcl-lang.org\/page\/TDBC\">TDBC interface<\/a> that is already provided with HammerDB.\u00a0\u00a0 As an example although not currently visible in HammerDB the previosuly supported Trafodion database was interfaced with TDBC and is still present in the src directory. Therefore this can provide an example of adding a new database with TDBC.<\/p>\n<p>If you plan for your database to be included in a HammerDB release then you will need to ensure that the client library you use works on both Linux and Windows and that the interface is open source.<\/p>\n<p>Once you have decided to go ahead and add support for a new database to HammerDB and have a working client for Linux and Windows go ahead and create an <a href=\"https:\/\/github.com\/TPC-Council\/HammerDB\/issues\">Issue on theTPC\u00a0 GitHub site\u00a0 <\/a>this will show to the HammerDB developers and others that you are considering adding support for a new database and provide the opportunity for discussion of your plans.\u00a0 It is also a place to reach out for help if you get stuck. For an example there is an existing Issue to add MariaDB as a separate database on the HammerDB site.<\/p>\n<p><a href=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2019\/07\/maria11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-511\" src=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2019\/07\/maria11.png\" alt=\"\" width=\"594\" height=\"99\" srcset=\"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2019\/07\/maria11.png 594w, https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2019\/07\/maria11-300x50.png 300w\" sizes=\"auto, (max-width: 594px) 100vw, 594px\" \/><\/a><\/p>\n<p>Therefore this example series of posts will take the steps to show how to add support for this database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A very common request is for HammerDB to add support for a new database. Before reaching out with a request your first reference should be the DB-Engines Ranking\u00a0 to gauge the relative popularity of a database.\u00a0 it is no coincidence that HammerDB supports the most popular databases with all of the databases currently supported being &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hammerdb.com\/blog\/uncategorized\/how-to-add-your-database-to-hammerdb-pt1-opening-an-issue\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to add your database to HammerDB &#8211; Pt1 Opening an issue&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"ppma_author":[5],"class_list":["post-442","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"authors":[{"term_id":5,"user_id":2,"is_guest":0,"slug":"hammerdb","display_name":"HammerDB","avatar_url":{"url":"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/logo-white.png","url2x":"https:\/\/www.hammerdb.com\/blog\/wp-content\/uploads\/2018\/10\/logo-white.png"},"author_category":"","user_url":"http:\/\/www.hammerdb.com","last_name":"","first_name":"","job_title":"","description":""}],"_links":{"self":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts\/442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":19,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"predecessor-version":[{"id":530,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/posts\/442\/revisions\/530"}],"wp:attachment":[{"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/tags?post=442"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.hammerdb.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}