Differences between revisions 5 and 6
Revision 5 as of 2007-07-17 15:19:26
Size: 2417
Editor: niemeyer
Comment:
Revision 6 as of 2007-07-17 15:21:01
Size: 2413
Editor: niemeyer
Comment:
Deletions are marked like this. Additions are marked like this.
Line 41: Line 41:
|| '''Bool''' || BOOL || TINYINT(1) || ''anything'' (*) ||
|| '''Int''' || SERIAL, BIGSERIAL, SMALLINT, INT, BIGINT || TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT || ''anything'' (*) ||
|| '''Float''' || FLOAT, REAL, DOUBLE PRECISION || FLOAT, REAL, DOUBLE PRECISION || ''anything'' (*) ||
## || '''Decimal''' || DECIMAL, NUMERIC, MONEY || DECIMAL, NUMERIC || ''anything'' (*) ||
|| '''Unicode || TEXT, VARCHAR, CHAR || TEXT, VARCHAR, CHAR || ''anything'' (*) ||
|| '''Chars''' || BYTEA || BLOB, BINARY, VARBINARY || ''anything'' (*) ||
|| '''DateTime''' || TIMESTAMP || DATETIME, TIMESTAMP || ''anything'' (*) ||
|| '''Date''' || DATE || DATE || ''anything'' (*) ||
|| '''Time''' || TIME || TIME || ''anything'' (*) ||
|| '''Bool''' || BOOL || TINYINT(1) || ''anything''(*) ||
|| '''Int''' || SERIAL, BIGSERIAL, SMALLINT, INT, BIGINT || TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT || ''anything''(*) ||
|| '''Float''' || FLOAT, REAL, DOUBLE PRECISION || FLOAT, REAL, DOUBLE PRECISION || ''anything''(*) ||
## || '''Decimal''' || DECIMAL, NUMERIC, MONEY || DECIMAL, NUMERIC || ''anything''(*) ||
|| '''Unicode''' || TEXT, VARCHAR, CHAR || TEXT, VARCHAR, CHAR || ''anything''(*) ||
|| '''Chars''' || BYTEA || BLOB, BINARY, VARBINARY || ''anything''(*) ||
|| '''Date``Time''' || TIMESTAMP || DATETIME, TIMESTAMP || ''anything''(*) ||
|| '''Date''' || DATE || DATE || ''anything''(*) ||
|| '''Time''' || TIME || TIME || ''anything''(*) ||

Storm Manual

This is the detailed documentation for Storm. For a more hands-on approach, check out the [:Tutorial: Tutorial].

Databases

The create_database() function

The create_database() function has the following prototype:

database = create_database(uri)

The uri parameter may be either a URI string or a URI object. The following URIs are examples of acceptable syntax:

  • backend:database_name

  • backend://hostname/database_name

  • backend://hostname:port/database_name

  • backend://username:password@hostname/database_name

  • backend://hostname/database_name?option=value

  • backend://username@/database_name

MySQL

PostgreSQL

SQLite

The Store interface

The ResultSet interface

Properties

Table of properties vs. database types

Property

PostgreSQL

MySQL

SQLite

Bool

BOOL

TINYINT(1)

anything(*)

Int

SERIAL, BIGSERIAL, SMALLINT, INT, BIGINT

TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT

anything(*)

Float

FLOAT, REAL, DOUBLE PRECISION

FLOAT, REAL, DOUBLE PRECISION

anything(*)

Unicode

TEXT, VARCHAR, CHAR

TEXT, VARCHAR, CHAR

anything(*)

Chars

BYTEA

BLOB, BINARY, VARBINARY

anything(*)

DateTime

TIMESTAMP

DATETIME, TIMESTAMP

anything(*)

Date

DATE

DATE

anything(*)

Time

TIME

TIME

anything(*)

(*) SQLite won't enforce data types, so they just must be formatted properly.

References

One-to-one

Many-to-one

Many-to-many

The Reference interface

The ReferenceSet interface

Expressions

Creating a backend

Testing

It's easy to test that Storm features are working with new backends. There are base test classes in tests/store/database.py and tests/store/base.py which may be inherited by database-specific test cases. Look at other backends to get a feeling of how it works.

If these tests pass with a new backend, you may be pretty sure that Storm is working fine with the created backend.

colin's_manual_edit (last edited 2008-12-22 11:27:49 by theboff)