root/galaxy-central/eggs/sqlalchemy_migrate-0.5.4-py2.6.egg/migrate/changeset/databases/postgres.py @ 3

リビジョン 3, 1.6 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1"""
2   `PostgreSQL`_ database specific implementations of changeset classes.
3
4   .. _`PostgreSQL`: http://www.postgresql.org/
5"""
6from migrate.changeset import ansisql
7from sqlalchemy.databases import postgres as sa_base
8#import sqlalchemy as sa
9
10
11PGSchemaGenerator = sa_base.PGSchemaGenerator
12
13
14class PGSchemaGeneratorMixin(object):
15    """Common code used by the PostgreSQL specific classes."""
16
17    def _do_quote_table_identifier(self, identifier):
18        return identifier
19
20    def _do_quote_column_identifier(self, identifier):
21        return '"%s"'%identifier
22
23
24class PGColumnGenerator(PGSchemaGenerator, ansisql.ANSIColumnGenerator,
25                        PGSchemaGeneratorMixin):
26    """PostgreSQL column generator implementation."""
27    pass
28
29
30class PGColumnDropper(ansisql.ANSIColumnDropper, PGSchemaGeneratorMixin):
31    """PostgreSQL column dropper implementation."""
32    pass
33
34
35class PGSchemaChanger(ansisql.ANSISchemaChanger, PGSchemaGeneratorMixin):
36    """PostgreSQL schema changer implementation."""
37    pass
38
39
40class PGConstraintGenerator(ansisql.ANSIConstraintGenerator,
41                            PGSchemaGeneratorMixin):
42    """PostgreSQL constraint generator implementation."""
43    pass
44
45
46class PGConstraintDropper(ansisql.ANSIConstraintDropper,
47                          PGSchemaGeneratorMixin):
48    """PostgreSQL constaint dropper implementation."""
49    pass
50
51
52class PGDialect(ansisql.ANSIDialect):
53    columngenerator = PGColumnGenerator
54    columndropper = PGColumnDropper
55    schemachanger = PGSchemaChanger
56    constraintgenerator = PGConstraintGenerator
57    constraintdropper = PGConstraintDropper
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。