DataBook 1.1 First steps Congratulations! You downloaded DataBook, a powerful data visualization and navigation tool for relational databases from REVER. For Windows, after installing the program, launch DataBook in the Start menu. For Linux, after unzipping the file in any directory (zero installation, it works even on an external usb drive), double-click the start.sh file in the chosen directory. This will start a Jetty server which is the DataBook server and your default browser with the url to connect to DataBook. By default, DataBook server will be started on port 8081. If you want to change it, just give the port number as the first argument of start.bat (for ex start.bat 8080 to start it on port 8080). The first screen Your first DataBook screen looks like this : The upper buttons classically allow you to choose your language, to access the first steps manual (the document you are reading now), or the online help (to be clicked only when you will be familiar with the product, this online help is a reference manual). In order to quickly discover the main features of the tool, it comes with a sample Sqlite database, Birt. DataBook works with projects. A project is a set of one or more databases that can have some functional connections (sharing some concepts), with some settings. The data model of a project is saved in a file with extension.lun. There are four ways to open a project from the main screen. 1. Create file : with this button, DataBook will connect to your database and extract the data structures to create a new project data model ; you do not need to do anything except discover your data structures and visualize your data, DataBook will also save a copy of the model file (.lun) in the directory %APPDATA%\Rever\DataBook\lunList in windows (usually APPDATA = C:\user\userName\AppData\Roaming) and ~/.databook/lunlist in Linux, so that you will retrieve and re-use it easily later. 2. Open external file : this button allows you to select, from your local drives or anywhere on your network, open and visualize an existing data model. 1
3. Upload : with this button, you can upload an existing project data model from any location on your network to the DataBook local folder. 4. For choosing and opening an existing project. The project files contain the data models, namely a description of the tables, the columns and the relationships. They may be viewed and edited with DB-Main (another free tool from Rever, see www.db-main.eu ) as well as by DataBook. Let's directly open an existing project (birt.lun) with the sample database: The application waits for you to enter your password (for security reasons, passwords are not saved in Databook, but your browser might do it). Sqlite does not require a user name nor a password, so you can click on the Open button directly, which might not be the case for other databases. The main screen DataBook screen is divided into 3 parts: 1. The header contains general options such as returning to the first screen, display the help, filtering the data, or changing the language of the interface. 2. The left menu is used to access to the different screens of the tool: 2
Connections: the list of the database connections used by the project Model: the model (list of the tables and links) defined in the project Data: to visualize the data and meta-data of the project. Query: to enter a user-defined query in SQL (e.g. a Create Table() query) Other functions: to quickly give your opinion about new functions we are developing for the next version of DataBook. 3. The data part (on the right) displays the data depending on the selected menu option. Data visualization The data visualization screen is the first to be displayed when a project is opened. Customers is a table of the database. Its first lines of data are displayed: On the left side of the panel, under the title Data, you will find the list of the available tables. At the end of this list, in italic, you will find the views (LAST_ORDER_DATE and TOT_LINE) defined in the database. For example you may click Products or Employees to visualize their content. The central part of the screen shows the columns of the customer table; if necessary, a horizontal or a vertical scroll bar will appear too. Back to table Customers, on the upper side of the screen, you will see all the other information reachable from a customer, by using the links. From a customer, it is possible to reach the related: Employees (L1) LAST_ORDER_DATE (L2) 3
Payments (L3) Orders (L4) This will show all the rows of the selected table which are linked to the customer by the selected link (foreign key). If you click on the Count button (top right), the right part of the panel will give you the number of rows in the target table reachable for each row of the previewed data. This exclusive feature of the product deserves a few explanations: Each number in the table shows how many rows of the target table can be reached by following the corresponding link from the displayed table. In the Birt example, that means that the customer #124, Mini Gifts Distrib, is related to one Employee (L1), to 17 LAST_ORDER_DATE (L2), to 9 Payments (L3) and to 17 Orders (L4): Each of the displayed numbers at the end of the row is a direct hyperlink to the concerned information, so a click on the number 9 in column L3 of the Mini Gifts customer would show its Payments (leaving the cursor a few seconds on the link will display the details of the used link) : CustomerNumber <- Payments(customerNumber) And while you follow these existing links, DataBook will build a breadcrumb trail (top left) so that you can restart your navigation from any table you selected previously: In the left hand menu, select the OrderDetails table: Now, you can see that DataBook displays two links, one to the Orders table (L2) and one to the Products table (L1). Actually, link L2 is a foreign key declared in the database, and L1 is a userdefined business link, declared in the model page, as explained later. For the moment, you can notice that no difference appears between the two links on the current page, DataBook treats them in the same way to browse through your data. So clicking the L1 number/link at the right of the fifth row (with productcode = S18_2325) as shown in the previous screen shot will display the details of product S18_2325: 4
And using the navigation button, you may see: the ProductLine information about the Vintage cars (L1) or the 28 OrdersDetails that contain this product (L2) Edit If you are allowed to edit the data, use the Edit ( ) button at the left side of the line. A new pop-up edit panel will be displayed to allow you to modify the data: Close this window either with the Save button to keep your changes or the Cancel button to return to the previous screen without applying your data modifications. 5
The model The Model ( between the tables. ) allows you to explore tables and views defined into the project and the link On the bottom of this screen, you can see the clusters (groups of independent tables). Leaving the cursor a few seconds on the cluster will give you the complete list of its tables as a hint text: When you click on one of the line, all the tables of the cluster are displayed in the DEPENDENCIES panel: The preview button ( ) at the end of the line allows you to see the cluster in graphical form. The tables are in black, the views are in blue, the explicit links are in black and the user-added links are shown in red. 6
The top table, labeled List of relationships, contains all the links between data: explicitly defined in the database as a constraint (Elk) or user-defined (DataBook can use it for navigation purposes, even if unknown to the RDBMS) (Ilk). 7
Adding new business links For example, let's add a business link (Ilk) between the TOT_LINE and the Orders information: In the filtering part of the screen, click the New Ilk button. In ORIGIN part of the new panel, choose TOT_LINE as the origin Table of the new link, then ORDER_NR in the Candidate columns, then click the left arrow to move it in the Columns list In the TARGET part of the new Ilk screen, select Orders as target tables and the primary key ORDERNUMBER will automatically be chosen by DataBook as the suggested target column of your new business link. Click the save button when done. Your new relationship now appears in the list ; it is the only row you can delete, the others beeing defined by the database: Exploring the description of the structures we now have a good knowledge of the birt database: It contains Customers who can pass several Orders, and the OrderDetails table containing the real 8
order information such as ordered products, prices and quantities. There is also a link between the customer and the payment information and another link allowing us to retrieve the employee in charge of a customer and its orders. 9
User-defined query Like any SQL editor, DataBook allows you to define your own queries (if you have a knowledge of the SQL language): either to create your new database (with commands like ALTER TABLE, CREATE INDEX,...) or to execute multiple selections in one extraction (with the AND keyword in the where clause) or to use RDBMS specific functions (like YEAR or SUBSTRING functions) Click the Query button in the left hand menu. The following screen will appear: Enter your user-defined query and click the execute button: If you entered a correct SELECT, the result will be directly displayed in a normal data window like if it was a normal table or view: 10
If you type a few more queries, you can see them all and go back to a previous one with the History. You can also save your favorite queries for future sessions with the Save button and retrieve them in the Saved queries list. 11
Create a new project On the first screen, clicking the create ( ) button allows us to define a connection to a new database (a project or application may be based on several databases, even managed by various RDBMS like Oracle, db2, SqlServer,...) Give a name to your new project (for example MyBirt) Select a RDBMS type in the drop down list (Sqlite in our example), DataBook will automatically fill the driver text box with the standard driver for this RDBMS, the URL box with a pattern that you should edit as shown in the picture, and the left and right delimiters, which are characters used to encompass identifier names (schema name, table names, column, names,...) in SQL queries sent to the database. Type your credentials (leave it empty for Sqlite) When ready, click the Save button. DataBook connects to the database, retrieves the data model and creates the new connection. Then the program displays a confirmation panel that also allows you to define an extra connection for the same project, if necessary: 12
Over the cloud While DataBook is running on your desktop computer, you can access it from your smartphone or your tablet for showing the data to your coworkers or for your own information during a meeting e.g. To do so, you just need to be sure that the firewall on your PC leaves port 8081 open, at least in the local area network, open your favorite browser on your mobile device, and type the following URL: http://<address of your PC>:8081. Note that this port number, 8081, should be adapted to the port number you set when starting Databook, as explained in the beginning of these first steps, if you did so. Other functions Clicking this button will allow you to fill a 10 clicks inquiry on our web site and to quote several new features we are developing for the next version of this free but great product. Depending on your job, you could be interested by some of them or suggest new ideas about your needs. Thank you for helping us to improve DataBook. The end? With this little tutorial, we have seen the most original (follow the links, existing or customized) feature of DataBook. You can now click the help button to access the complete reference manual. For information about other products or services from REVER: www.rever.eu 13