Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(0)  |  Derive(0)  |  Import(4)
An SQL table which consists of columns
and constraints. It is prepopualted with an _id column
which is the primary key.

Example usage:
>>> Table('People')
CREATE TABLE People
  (_id INTEGER PRIMARY KEY
<BLANKLINE>
  )

>>> Table('People').add_cols(Column('name').text.not_null.default("''"),                                  Column('age').integer.not_null.default(18))
CREATE TABLE People
  (_id INTEGER PRIMARY KEY,
  name TEXT NOT NULL DEFAULT '',
  age INTEGER NOT NULL DEFAULT 18
<BLANKLINE>
  )

>>> Table('Albums').add_cols(Column('albumname').text.not_null.default("''"),                                  Column('artistname').text.not_null).add_constraints(ForeignKey('artistname').references('artist', 'name')              .on_delete_cascade,             Unique('albumname').on_conflict_replace)
CREATE TABLE Albums
  (_id INTEGER PRIMARY KEY,
  albumname TEXT NOT NULL DEFAULT '',
  artistname TEXT NOT NULL,
<BLANKLINE>
  FOREIGN KEY (artistname) REFERENCES artist(name) ON DELETE CASCADE,
  UNIQUE (albumname) ON CONFLICT REPLACE)

src/a/n/AndroidCodeGenerator-HEAD/sample_with_trigger.py   AndroidCodeGenerator(Download)
"""Generate a sample project with triggers"""
 
from AndroidCodeGenerator.generator import Generator
from AndroidCodeGenerator.db_table import (Table, Column, ForeignKey, Unique,
                                           Trigger)

src/a/n/AndroidCodeGenerator-HEAD/sample_test.py   AndroidCodeGenerator(Download)
 
from AndroidCodeGenerator.generator import Generator
from AndroidCodeGenerator.db_table import (Table, Column, ForeignKey, Unique,
                                           Trigger)
from AndroidCodeGenerator.database_triggers import DatabaseTriggers

src/a/n/AndroidCodeGenerator-HEAD/sample.py   AndroidCodeGenerator(Download)
"""Generate a sample project"""
 
from AndroidCodeGenerator.generator import Generator
from AndroidCodeGenerator.db_table import Table, Column, ForeignKey, Unique
 

src/a/n/AndroidGCMTutorial-HEAD/linksdb.py   AndroidGCMTutorial(Download)
"""Generate a sample project"""
 
from AndroidCodeGenerator.generator import Generator
from AndroidCodeGenerator.db_table import (Table, Column, ForeignKey,
                                           Unique, Trigger)