Skip to content

Commit

Permalink
Use the same naming for the prefixes in CSV importer/exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
bgol committed Nov 28, 2014
1 parent 4679226 commit 51b6829
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions commands/export_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ def run(results, cmdenv, tdb):
bindValues = []
tableStmt = ''

# prefix for unique columns
# prefix for unique/ignore columns
uniquePfx = "unq:"
ignorePfx = "!"

tableCursor = conn.cursor()
for row in tableCursor.execute("""
Expand Down Expand Up @@ -238,7 +239,9 @@ def run(results, cmdenv, tdb):
csvPfx = ''
joinStmt = 'USING({})'.format(keyRow['joinColumn'])
else:
csvPfx = '!'
# this column must be ignored by the importer, it's only
# used to resolve the FK relation
csvPfx = ignorePfx
joinStmt = 'ON {}.{} = {}.{}'.format(keyRow['table'], keyRow['joinColumn'], keyRow['joinTable'], keyRow['joinColumn'])
if col['name'] in unqIndex:
# column is part of an unique index
Expand Down

0 comments on commit 51b6829

Please sign in to comment.