1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
.TH sqlheavy-gen-orm 1 "29 April 2010" "sqlheavy-gen-orm-0.0.1" "SQLHeavy"
.SH NAME
sqlheavy-gen-orm \- SQLHeavy ORM Generator
.SH SYNOPSIS
.B sqlheavy-gen-orm
[\fIOPTION...\fR] \fISOURCE\fR...
.SH DESCRIPTION
This tool will generate a Vala file which provides an object for each table in the specified database(s), each of which extends the SQLHeavyRecord class.
You should pass at least one SQLite database file, which it will examine to produce the output. Additionally, you can specifiy metadata files (which is a key file), as well as vala files to provide custom code in the output.
.SH OPTIONS
.TP
.B --help
.TP
.B -o, --output=\fIFILE\fR
Write output to \fIFILE\fR (defaults to stdout)
.TP
.B -m, --metadata=\fIFILE\fR
Load metadata from \fIFILE\fR
.TP
.B --vapidir=\fIDIRECTORY\fR
Look for package bindings in \fIDIRECTORY\fR
.TP
.B --pkg=\fIPACKAGE\fR
Include binding for PACKAGE
.TP
.B -o, --output=\fIFILE\fR
Output to \fIFILE\fR (default is stdout)
.TP
.B -p, --properties
Write properties instead of methods
.SH METADATA FORMAT
The concept of the metadata files is similar to that of vapigen (in fact, the entire sqlheavy-gen-orm tool is largely inspired by vapigen), but it uses the key file format so that it can use the GLib Key-Value file parser. Databases, tables, and columns are all represented by groups, each of which may have any number of properties (the key value pairs).
.SS Selectors
The format for the selectors is relatively straightforward. A forward slash ("/") is used as the separator character, and prepending an @ to a token means that token refers to a database, and prepending a % means that token refers to a table. The database name is the name of the database file, not including the last dot character and anything following it (i.e., the extension). An asterisk can be used as a wildcard. Several examples, as well as an explanation of each:
.TP
.B @foo/bar/baz
The baz symbol in the bar table in the foo database.
.TP
.B @foo
The foo database
.TP
.B %bar/baz
The baz column in the bar table in any database
.TP
.B baz
The baz column in any table in any database
.TP
.B \@foo/*/baz
The baz column in any table in the foo database
.TP
.B */\%bar
The bar table in any database
.SS Properties
Properties are represented by key-value pairs. The following is a table of currently implemented properties:
.TS
box, tab(:);
c | c | c | c
l | l | l | l.
Name:Type:DB/TBL/COL:Purpose
=
name:string:Y/Y/Y:Rename the symbol
type:string:N/N/Y:Set the Vala type of the column
hidden:bool:Y/Y/Y:Do not create a binding
.TE
.SS Custom Vala
In addition to providing one or more SQLite database as a basis for code generation, you can provide an existing *.vala file. Theoretically, this will allow you to place custom code in a separate file, so that you can use sqlheavy-gen-orm to update the generated code without losing whenever the database schema changes, and you will not lose any enhancements you made. The generated code will be merged into the custom vala file in order to generate the output.
.SH HOMEPAGE AND BUG REPORT
http://code.google.com/p/sqlheavy
.SH AUTHORS
Evan Nemerson
|