~ubuntu-branches/debian/sid/sqlheavy/sid

« back to all changes in this revision

Viewing changes to docs/sqlheavy-gen-orm.1

  • Committer: Package Import Robot
  • Author(s): Devid Antonio Filoni
  • Date: 2011-10-23 15:43:22 UTC
  • Revision ID: package-import@ubuntu.com-20111023154322-unzj3fz2aj4g6cl8
Tags: upstream-0.1.0
ImportĀ upstreamĀ versionĀ 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH sqlheavy-gen-orm 1 "29 April 2010" "sqlheavy-gen-orm-0.0.1" "SQLHeavy"
 
2
.SH NAME
 
3
sqlheavy-gen-orm \- SQLHeavy ORM Generator
 
4
.SH SYNOPSIS
 
5
.B sqlheavy-gen-orm
 
6
[\fIOPTION...\fR] \fISOURCE\fR...
 
7
.SH DESCRIPTION
 
8
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.
 
9
 
 
10
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.
 
11
.SH OPTIONS
 
12
.TP
 
13
.B --help
 
14
.TP
 
15
.B -o, --output=\fIFILE\fR
 
16
Write output to \fIFILE\fR (defaults to stdout)
 
17
.TP
 
18
.B -m, --metadata=\fIFILE\fR
 
19
Load metadata from \fIFILE\fR
 
20
.TP
 
21
.B --vapidir=\fIDIRECTORY\fR
 
22
Look for package bindings in \fIDIRECTORY\fR
 
23
.TP
 
24
.B --pkg=\fIPACKAGE\fR
 
25
Include binding for PACKAGE
 
26
.TP
 
27
.B -o, --output=\fIFILE\fR
 
28
Output to \fIFILE\fR (default is stdout)
 
29
.TP
 
30
.B -p, --properties
 
31
Write properties instead of methods
 
32
.SH METADATA FORMAT
 
33
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).
 
34
.SS Selectors
 
35
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:
 
36
.TP
 
37
.B @foo/bar/baz
 
38
The baz symbol in the bar table in the foo database.
 
39
.TP
 
40
.B @foo
 
41
The foo database
 
42
.TP
 
43
.B %bar/baz
 
44
The baz column in the bar table in any database
 
45
.TP
 
46
.B baz
 
47
The baz column in any table in any database
 
48
.TP
 
49
.B \@foo/*/baz
 
50
The baz column in any table in the foo database
 
51
.TP
 
52
.B */\%bar
 
53
The bar table in any database
 
54
.SS Properties
 
55
Properties are represented by key-value pairs. The following is a table of currently implemented properties:
 
56
.TS
 
57
box, tab(:);
 
58
c | c | c | c
 
59
l | l | l | l.
 
60
Name:Type:DB/TBL/COL:Purpose
 
61
=
 
62
name:string:Y/Y/Y:Rename the symbol
 
63
type:string:N/N/Y:Set the Vala type of the column
 
64
hidden:bool:Y/Y/Y:Do not create a binding
 
65
.TE
 
66
.SS Custom Vala
 
67
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.
 
68
.SH HOMEPAGE AND BUG REPORT
 
69
http://code.google.com/p/sqlheavy
 
70
.SH AUTHORS
 
71
Evan Nemerson