Permalink
Commits on Mar 20, 2012
  1. Fix dbtoyaml -t to output sequences owned by tables and schema descri…

    jmafc committed Mar 20, 2012
    …ption.
    
     * pyrseas/database.py (Database.to_map): Add schemas and tables as
       arguments. Move modified code from dbtoyaml.py and adjust it to
       output owned sequences and schema description.
     * pyrseas/dbtoyaml.py: Remove code for trim schemas/tables and pass
       new arguments.
     * pyrseas/testutils.py (PostgresDb.execute_and_map): Add schemas and
       tables arguments and pass them on to to_map.
     * tests/dbobject/test_schema.py: New regression test.
     * tests/dbobject/test_table.py: New regression tests.
    
    Requires further work, but these changes suffice for r0.5.
Commits on Mar 19, 2012
Commits on Mar 16, 2012
  1. Schema-qualify table when dropping columns. Fixes #26.

    jmafc committed Mar 16, 2012
     * pyrseas/dbobject/column.py (Column.drop): Add schema qualification.
     * tests/dbobject/test_column.py: New regression test.
  2. Normalize creation/dropping of schemas in tests.

    jmafc committed Mar 16, 2012
     * pyrseas/testutils.py (PostgresDb.clear): Drop all non-public
       schemas at the beginning. Simplify remaining steps.
     * tests/dbobject/test_table.py: Move test_create_table_within_schema
       here from test_schema.py.
     * tests/dbobject/test_*.py: Remove special-case code to drop schema s1.
Commits on Mar 14, 2012
  1. Additional changes to make Pyrseas run under Python 3.

    jmafc committed Mar 14, 2012
     * pyrseas/database.py, pyrseas/dbobject/*.py: Wrap dict items(),
       keys() and values() with list().
     * pyrseas/dbobject/table.py (Sequence.to_map): Refine handling of int
       values.
     * tests/dbobject/__init__.py: Use explicit import statements.
Commits on Mar 12, 2012
  1. Additional fix of queries to correctly exclude internal schemas.

    jmafc committed Mar 12, 2012
     * pyrseas/testutils.py (PostgresDb.clear): Exclude pg_catalog and
       information_schema instead of joining to pg_roles.
    
    See commits 5a6e4bc and 8d92dd8 10 Oct 2011 for original changes.
  2. Fix dbconn.py exception handling under Python 3. Fixes #25.

    jmafc committed Mar 12, 2012
      Author: Chris Mayo
Commits on Mar 10, 2012
  1. Update release files for 0.5.0.

    jmafc committed Mar 10, 2012
  2. Changes to foreign tables should use ALTER FOREIGN TABLE.

    Ronan Dunklau authored and jmafc committed Mar 10, 2012
     * pyrseas/dbobject/column.py (Column.drop): Use objtype instead of
       hard-coding 'TABLE'.
     * pyrseas/dbobject/foreign.py (DbObjectWithOptions.diff_map): Invoke
       super method.
     * pyrseas/dbobject/table.py (Table.diff_map): Use objtype instead of
       hard-coding 'TABLE'.
     * tests/dbobject/test_foreign.py: New test to verify changes.
    
    Main changes by Ronan Dunklau, test by Joe Abbate.
Commits on Mar 9, 2012
  1. Add support for modification of OPTIONS of FDW-related objects.

    jmafc committed Mar 9, 2012
     * docs/foreign.rst: Document new helper class DbObjectWithOptions.
     * pyrseas/dbobject/foreign.py (DbObjectWithOptions): New helper
       class.  ({ForeignDataWrapper, ForeignServer, UserMapping,
       ForeignTable}): Derive from new helper class, add diff_map method
       (except for UserMapping) and change create method.
     * tests/dbobject/test_foreign.py: New tests to verify OPTIONS changes.
  2. Correct order of creation/destruction of FDW-related objects.

    jmafc committed Mar 9, 2012
     * pyrseas/database.py (Database.diff_map): Reorder calls and add
       calls to drop servers and FDWs.
     * pyrseas/dbobject/foreign.py (ForeignDataWrapperDict.diff_map): Mark
       wrappers to be dropped.  (ForeignDataWrapperDict._drop): New method
       to actually drop the wrappers.  (ForeignServerDict.diff_map): Mark
       servers to be dropped.  (ForeignServerDict._drop): New method to
       actually drop the servers.
     * tests/dbobject/test_foreign.py: New tests to verify order of
       multiple object creation/destruction.
  3. Change user mappings to be listed under their servers in YAML output.

    jmafc committed Mar 9, 2012
     * docs/foreign.rst: Add new automethods.
     * pyrseas/database.py (Database.link_refs): Link user mappings to
       their servers.  (Database.from_map): Remove mapping of input user
       mappings.  (Database.to_map): Remove mapping of user mappings.
     * pyrseas/dbobject/foreign.py (ForeignDataWrapperDict.from_map): Add
       newdb argument to downstream call.  (ForeignServer.to_map): New
       method to output user mappings as part of their servers.
       (ForeignServer.from_map): Handle user mappings as this level.
       (ForeignServerDict.link_refs): New method to link mappings and
       servers.  (ForeignServer.extern_key): Change output format.
       (Foreign.UserMappingDict.query): Add join to
       pg_foreign_data_wrapper and change sort order.
       (UserMappingDict.from_map): Change arguments and reorganize for new
       input.  (UserMappingDict.diff_map): Change key tuples.
     * tests/dbobject/test_foreign.py: Adjust tests to new input and
       output.
Commits on Mar 7, 2012
  1. Change foreign servers to be listed under their wrappers in YAML output.

    jmafc committed Mar 7, 2012
     * docs/foreign.rst: Add new automethods.
     * pyrseas/database.py (Database.link_refs): Link servers to their FD
       wrappers.  (Database.from_map): Remove mapping of input servers.
       (Database.to_map): Remove mapping of servers.
     * pyrseas/dbobject/foreign.py (ForeignDataWrapper.to_map): New method
       to output servers as part of their wrappers.
       (ForeignDataWrapperDict.from_map): Handle servers as this level.
       (ForeignDataWrapperDict.link_refs): New method to link servers and
       wrappers.  (ForeignServer.identifier): New method.
       (Foreign.ServerDict.query): Order by FDW first.
       (ForeignServerDict.from_map): Use FDW as part of key.
     * tests/dbobject/test_foreign.py: Adjust tests to new input and
       output.
Commits on Mar 6, 2012
  1. Add support for PG 9.1 foreign tables.

    jmafc committed Mar 6, 2012
     * docs/foreign.rst: Document new features.
     * pyrseas/database.py (Database.Dicts.__init__): Add dictionary for
       foreign tables. (Database.link_refs): Add foreign tables to
       schemas.link_refs and add ftables.link_refs. (Database.diff_map):
       Call diff_map for foreign tables.
     * pyrseas/dbobject/column.py (ColumnDict.query): Retrieve foreign
       table columns.
     * pyrseas/dbobject/foreign.py: Add ForeignTable and ForeignTableDict
       class to implement new features.  Add options_clause helper
       function to abstract creation of OPTIONS clauses.
     * pyrseas/dbobject/schema.py (Schema.to_map): Add ftables to
       objtypes.  (SchemaDict.from_map): Process foreign tables in input.
       (Schema.link_refs): Link foreign tables to their schemas.
     * pyrseas/testutils.py (PostgresDb.clear): Drop foreign tables if
       they exist.
     * tests/dbobject/test_foreign.py: Add new test cases for foreign
       tables.
Commits on Mar 5, 2012
  1. Merge pull request #24 from rdunklau/patch-2

    jmafc committed Mar 5, 2012
    Fix small bug on "create foreign data wrapper" statement.
  2. Merge pull request #23 from rdunklau/patch-1

    jmafc committed Mar 5, 2012
    Change 'username' destination
  3. Fix small bug on "create foreign data wrapper" statement.

    Ronan Dunklau
    Ronan Dunklau committed Mar 5, 2012
    When an option value contains the '=' character, the code would fail because opt.split('=') would return a list bigger than 2 items.
  4. Change 'username' destination to the 'username' attribute instead of …

    Ronan Dunklau
    Ronan Dunklau committed Mar 5, 2012
    …user, since that's what is used in the code.
Commits on Mar 3, 2012
  1. Changes to make Pyrseas tests run under Python 3.2.

    jmafc committed Mar 3, 2012
     * pyrseas/database.py (flatten): Replace basestring by str.
     * pyrseas/dbobject/__init__.py: Replace string.lowercase by
       string.ascii_lowercase.
     * pyrseas/dbobject/constraint.py (ConstraintDict.from_map): Use
       list() around dict.keys().
     * pyrseas/dbobject/function.py (ProcDict.diff_map): Replace
       basestring by str.
     * pyrseas/dbobject/index.py (Index.key_columns): Replace basestring
       by str. Use list() to wrap dict.keys() and dict.values().
     * pyrseas/dbobject/schema.py (SchemaDict.from_map): No need to remove
       oldname from input schema.
     * pyrseas/dbobject/table.py (MAX_BIGINT): Remove trailing 'L'.
       (Sequence.to_map): Replace sys.maxint by sys.maxsize, test for
       int/long under Python 2 and for int only under Python 3.
     * tests/dbobject/test_constraint.py
       (ForeignKeyToMapTestCase.test_foreign_key_deferred): Replace
       assert_ by AssertTrue.
     * setup.py: Add several Python classifiers and change development
       status to beta.
Commits on Mar 1, 2012
  1. Replace optparse by argparse, and allow spec to yamltodb to come from…

    jmafc committed Mar 1, 2012
    … stdin.
    
     * docs/cmdargs.rst: New page for common command line options.
     * docs/dbtoyaml.rst: Move common options to new page.
     * docs/index.rst: Add extender in Features, argparse in Requirements,
       cmdargs in Contents.
     * docs/yamltodb.rst: Move common options to new page.  Indicate spec
       argument can be omitted and will use stdin instead.  Add new
       examples.
     * pyrseas/cmdargs.py: New module to define parent_parser function.
     * pyrseas/{dbtoyaml.py,yamltodb.py}: Replace optparse by argparse and
       move common arguments to new parent_parser.
Commits on Feb 28, 2012
  1. Implement support for foreign data wrappers, servers and user mappings.

    jmafc committed Feb 28, 2012
     * docs/foreign.rst: Document new objects.
     * docs/index.rst: Add foreign.rst.
     * pyrseas/database.py (Database.Dicts.__init__): Add dictionaries for
       new objects.  (Database.from_map): Process new input objects.
       (Database.diff_map): Call diff_map's for new objects.
     * pyrseas/dbobject/foreign.py: Add classes for new objects.
     * pyrseas/testutils.py (PostgresDb.clear): Drop existing FDWs,
       servers and user mappings.
     * tests/dbobject/__init__.py: Invoke new test module.
     * tests/dbobject/test_foreign.py: New test module.
  2. Change DROP COLUMN to handle DROP ATTRIBUTE if applicable. Fixes #22.

    jmafc committed Feb 28, 2012
     * pyrseas/dbobject/column.py (Column.drop): If Column object not attached
       to table, issue ALTER TYPE DROP ATTRIBUTE statement instead.
Commits on Feb 21, 2012
  1. Correct DbConnection instantiations as a result of commit 78aa961.

    jmafc committed Feb 21, 2012
     * pyrseas/testutils.py (PostgresDb.{execute_and_map,proces_map): Used
       named parameters for host and port since commit 78aa961 inserted
       extra positional argument.
Commits on Feb 8, 2012
Commits on Jan 19, 2012
Commits on Jan 13, 2012
  1. Add -W/--password option to dbtoyaml/yamltodb. Fixes #18.

    jmafc committed Jan 13, 2012
     * docs/dbtoyaml.rst, docs/yamltodb.rst: Document new option.
     * pyrseas/dbconn.py (DbConnection.__init__): Add pswd argument and
       prompt the uer if True.  (DbConnection.connect): Add password to
       connection string. If connect fails and it's a FATAL error, exit.
     * pyrseas/dbtoyaml.py, pyrseas/yamltodb.py: Add new option.
Commits on Jan 12, 2012
  1. Add support for INDEX column qualifiers. Fixes #16.

    jmafc committed Jan 12, 2012
     * pyrseas/dbobject/index.py (Index.key_columns): Rework to output
       expanded column clause.  (Index.to_map): Eliminate dbcols argument
       and remove code for keycols.  (Index.create): Use columns attribute
       instead of keycols.  (IndexDict.query): Fetch pg_get_indexdef.
       (IndexDict._from_catalog): Parse index defintion to build new
       columns list.  (IndexDict.from_map): Use columns attribute instead
       of keycols.
     * pyrseas/dbobject/table.py (Table.to_map): Remove argument to
       Index.to_map.
     * tests/dbobject/test_index.py: Add two tests for new functionality.
Commits on Jan 11, 2012
Commits on Jan 10, 2012
  1. Prepare for py3k: print(), except as, and imports.

    jmafc committed Jan 10, 2012
     * pyrseas/dbconn.py, pyrseas/dbobject/constraint.py,
       pyrseas/dbobject/index.py, pyrseas/dbobject/language.py,
       pyrseas/dbobject/rule.py, pyrseas/dbobject/schema.py
       pyrseas/dbobject/table.py, pyrseas/dbobject/textsearch.py: Change
       except Xxx, exc to except Xxx as exc.
     * pyrseas/dbobject/table.py, pyrseas/dbobject/schema.py: Use full
       paths for imports.
     * pyrseas/dbtoyaml.py, pyrseas/yamltodb.py: Replace print statement
       by print() function.
Commits on Jan 9, 2012