morilib relations: a relational database


Top - Guide - Reference - Functions - Using JDBC - Download - 日本語

A guide of morilib Relations


Installation

This is a guide of morilib Relations. Microsoft Windows 7 will use in this guide.

Morilib Relation needs Java SE Runtime Environment(JRE) 6 or above. You can download JRE or JDK from the websites shown as follows.

  1. JRE (http://java.com/ja/download/)
  2. JDK (http://www.oracle.com/technetwork/java/javase/downloads/index.html)

Now, we will install morilib Relations after installation of Java. Please download the file relations-0.0.1.msi from the website shown as follows.
http://en.sourceforge.jp/projects/relations/releases/

We will execute the file relations-0.0.1.msi after finishing the download.
The window shown below will be displayed and please select the "Next" button.

The End-User License Agreement will be displyed. Please check the checkbox "I accept the terms in the License Argument" and select "Next" button.

The window shown below will be displayed. Please select the "Next" button if you don't want to change the default install directory.

Please select the "Install" button and installation will be started.

Please select the "Finish" button and you will be ready to use morilib Relations.


How to use

Please make an empty folder and start the Windows Command Prompt. (In this guide, we supporse the folder C:\usr\work\reltest.)

Please input the command and a prompt will be displayed.

>replus C:\usr\work\reltest

The SHOW TABLES command is used for showing all tables in the directory. You will confirm that no table is found in the directory.

The CREATE TABLE statement is used for creating a table. Let's create a table by executing the SQL statement.

CREATE TABLE IDOLS (
  NAME VARCHAR,
  AGE NUMERIC,
  FAVORITE_SONG VARCHAR
);
In morilib Relations, the length of types may not be specified. The NUMERIC without the length is treated as exact rational numbers.

Let's confirm tables in the directory again. The table IDOLS will be found by executing SHOW TABLE command.

The DESC <table-name> command is used for introspecting a table definition.

Let's insert a column in the table by executing the SQL.

INSERT INTO IDOLS (NAME, AGE, FAVORITE_SONG)
VALUES ('HOSHII Miki', 15, 'Relations');

You can show the table by executing the SQL.

SELECT * FROM IDOLS;

You can exit by executing EXIT command.

Let's browse the folder which are made that time. You can find a CSV file and a DDL file in the folder.

The CREATE TABLE statement which you execute that time will be found in the DDL file.

And the record which you insert that time will be found in the CSV file.

The one of feature of morilib Relations is storing data not using the binary file, but human-readable file format such as CSV.
You can export/import databases by copying CSV files, and backup by copying a directory.


Yuichiro Moriguchi
yuichiro-moriguchi@nifty.com