Class Table
source code
description of a table
>>> table=Table('pants')
>>> table.size=Column(int, indexed=True)
>>> table.color=Column(unicode, indexed=True)
>>> table.bought_on=Column(datetime.date, optional=True)
>>> table.show()
CREATE TABLE pants (
__id__ text PRIMARY KEY NOT NULL,
bought_on date,
color text NOT NULL,
size integer NOT NULL)
CREATE INDEX idx_pants_color ON pants (color)
CREATE INDEX idx_pants_size ON pants (size)
>>> table.addMultiIndex('size', 'bought_on')
>>> table.addMultiIndex('color', 'size')
>>> table.addMultiIndex('size', 'color')
>>> table.show()
CREATE TABLE pants (
__id__ text PRIMARY KEY NOT NULL,
bought_on date,
color text NOT NULL,
size integer NOT NULL)
CREATE INDEX idx_pants_color ON pants (color)
CREATE INDEX idx_pants_size ON pants (size)
CREATE INDEX idx_pants_size_bought_on ON pants (size, bought_on)
CREATE INDEX idx_pants_color_size ON pants (color, size)
CREATE INDEX idx_pants_size_color ON pants (size, color)
|
|
__init__(self,
name)
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__str__
|
|
Inherited from object:
__class__
|
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
- Overrides:
object.__init__
- (inherited documentation)
|
x.__setattr__('name', value) <==> x.name = value
- Overrides:
object.__setattr__
- (inherited documentation)
|