mdb-export: Add boolean words option (TRUE/FALSE)

Adds "-B" (--boolean-words) option to mdb-export, which will reconfigure
mdb/data.c to export TRUE/FALSE for boolean values instead of 1/0.  The
option is needed to support BOOLEAN fields on PostgreSQL, which will not
implicitly cast bare 1/0 into a BOOLEAN value.  Value literals are the
SQL TRUE/FALSE, and _quoted_ words meaning true/false and _quoted_
'1'/'0'.  With this flag the SQL TRUE/FALSE values are output, which should
work with several SQL databases.

PostgreSQL Reference:

http://www.postgresql.org/docs/current/static/datatype-boolean.html
This commit is contained in:
Ewen McNeill
2016-04-07 08:45:06 +12:00
parent 3b6d88f347
commit 8b1db6c08e
3 changed files with 28 additions and 2 deletions

View File

@@ -496,6 +496,7 @@ extern size_t mdb_ole_read_next(MdbHandle *mdb, MdbColumn *col, void *ole_ptr);
extern size_t mdb_ole_read(MdbHandle *mdb, MdbColumn *col, void *ole_ptr, int chunk_size);
extern void* mdb_ole_read_full(MdbHandle *mdb, MdbColumn *col, size_t *size);
extern void mdb_set_date_fmt(const char *);
extern void mdb_set_boolean_fmt_words();
extern int mdb_read_row(MdbTableDef *table, unsigned int row);
/* dump.c */