Commit Graph

85 Commits

Author SHA1 Message Date
James Woodcock
9bf70e0e1e mdb-export: use sensible date formats 2020-10-24 09:41:39 +01:00
Evan Miller
7f7761e884 Improved support for "Short Date" fields
* Separate -D (date only) and -T (date/time) format options in mdb-export and mdb-json

* New public mdb_set_shortdate_fmt() function in libmdb

* New private(ish) mdb_col_is_shortdate() function

I'm calling it "shortdate" in order to preserve the existing API.

See https://github.com/mdbtools/mdbtools/issues/12
2020-09-02 22:14:57 -04:00
Evan Miller
aa0ce8fb3e Consolidate print_col functions into backend.c 2020-09-02 20:38:15 -04:00
Evan Miller
7b5d547acf Merge branch 'mysql-comments' of github.com:mdbtools/mdbtools into merge-164 2020-09-02 15:48:29 -04:00
Evan Miller
fb960553e6 New mdb_set_bind_size function overrides MDB_BIND_SIZE
This should fix long-standing complaints about the default bind size
without causing undue memory inflation in existing applications.

Could make this adjustable on the command line later.

Supersedes:

https://github.com/mdbtools/mdbtools/pull/137
2020-09-02 14:30:07 -04:00
Evan Miller
f668f25d99 Use GCC struct initializers for clarity 2020-08-20 15:37:05 -04:00
Evan Miller
452cd29343 Get rid of more static memory
* Replace backend_is_init (formerly is_init) with relationships_table

* Remove deprecated functions that used static variables

* Move static "bound" variable to MdbHandle as relationships_values
2020-08-20 08:47:13 -04:00
Evan Miller
588663675e Move backend dictionary and state to MdbHandle
Attempt to make the backend handling logic thread-safe. This removes the
last MDB_CONSTRUCTOR. Also get rid of some JAVA junk and make the
remaining static variables in backend.c constant. Finally remove some
obsolete fields from MdbFile.
2020-08-20 07:58:53 -04:00
Evan Miller
e7782f7821 Remove debugging comments from mdb-schema 2020-08-06 23:18:05 -04:00
Evan Miller
272bd191bc Merge branch 'master' into no-glib 2020-08-06 12:51:52 -04:00
Evan Miller
c67a92f459 Provide NUMERIC type in Postgres backend brianb/mdbtools#129 2020-08-06 08:20:11 -04:00
Evan Miller
edc20bcc39 Merge branch 'master' into no-glib 2020-08-06 08:16:06 -04:00
Evan Miller
c17aeb0826 Remove length specifier from MySQL TEXT types brianb/mdbtools#133 2020-08-06 08:15:06 -04:00
Evan Miller
68d3a22e77 Merge branch 'master' into no-glib 2020-08-05 18:49:24 -04:00
Evan Miller
d31bbe88c5 Fix crash when a date column lacks a Format property brianb/mdbtools#132 2020-08-05 18:33:33 -04:00
Evan Miller
e9f4c6c786 Remove GLib dependency WIP
Add a shim implementing half-assed versions of most of the GLib
functions used by MDB Tools. If GLib is detected at compile-time,
use it, otherwise use the shim.

This work is not complete, as the option-parsing code is not yet
implemented - so most of the command-line tools crash.
2020-08-03 17:19:40 -04:00
Evan Miller
cdde7c3268 Enable strict prototypes warnings, and fix warnings
If a host project has -Wstrict-prototypes enabled, the mdbtools header
results in warnings. Turn on -Wstrict-prototypes for the whole project
so that these never occur again.
2018-12-29 10:34:54 -05:00
Cyber Emissary
278f9ba441 Implemented bulk insert 2018-02-12 15:21:15 -05:00
Cyber Emissary
dbc7e51e98 do not include table name in MySQL indexes. 2018-02-06 13:11:13 -05:00
Cyber Emissary
fd230f68f2 precision and scale were used other way around. Flipped their usage
in all places
2018-02-06 13:10:56 -05:00
Cyber Emissary
702ce2b7cd fixed mysql types, and numeric scale/precision 2018-02-06 13:10:13 -05:00
Sam Shaw
ffccc9d1cf Oracle Foreign Keys
Oracle doesn't support the "ON UPDATE" clause for foreign keys.
2016-01-12 09:58:17 +08:00
Sam Shaw
7f21d4e030 Oracle BLOB & CLOB
BLOB and CLOB do not have a size constraint in Oracle
2015-12-23 13:46:31 +08:00
Sam Shaw
ffbc492a8b Oracle Indexes
Add syntax for creating indexes in oracle (it's the same as PostgreSQL)
2015-12-23 13:31:05 +08:00
Nirgal Vourgère
2a70e16a8b Allow CFLGAS="-std=c99 -D_POSIX_C_SOURCE=2"
Use glib function:
strcasecmp -> g_ascii_strcasecmp
bzero -> memset
strdup -> g_strdump

Don't use arithmetic void*+int
2014-12-28 12:36:55 +01:00
Mihai Draghicioiu
a2587a6830 Add database comments in mysql exports 2014-10-18 11:46:01 +02:00
Maurus Cuelenaere
e2c46bad8b Add MySQL support to mdb_print_indexes() 2014-10-17 22:18:34 +02:00
Maurus Cuelenaere
97ddfcf8b2 Introduce MDB_BACKEND_* enum 2014-10-17 22:16:49 +02:00
Maurus Cuelenaere
65b573637e Add MySQL support to mdb_print_indexes() 2014-03-17 13:30:40 +01:00
Maurus Cuelenaere
cce6cfead2 Introduce MDB_BACKEND_* enum 2014-03-17 13:30:28 +01:00
Nirgal Vourgère
7841d30d43 Revert use of config.h
Revert
7162e8db74
088493d499

And drop AC_CONFIG_HEADERS so that config goes though the command line.
No longer generating config.h, update .gitignore
2013-07-15 02:42:12 +02:00
Nirgal Vourgère
7162e8db74 Include config.h in all .c files
Need to be the first file since it may define large files support
and other options.
2013-07-04 10:53:13 +02:00
Nirgal Vourgère
6ef7da0597 Disabled schema comments for mysql backend
They were using an incorrect syntax
2013-06-29 12:13:09 +02:00
Nirgal Vourgère
8f0f167ab2 Memory leak fix
Free temporary variable in mdb_print_indexes
2013-06-28 17:54:30 +02:00
Nirgal Vourgère
687eeebe78 Memory leak fix
Need to free previous backend name when changing it.
2013-06-28 16:41:29 +02:00
Nirgal Vourgère
0196d34d7b __attribute__ change into macro
Makes it easier to port to another compiler.
Thanks Jimmy Taker
2013-06-28 01:51:52 +02:00
Jimmytaker
46005ae009 MDB_DEPRECATED redefined, Constructor MACRO, generate_table_schema changed to not static, date_fmt to ISODate
__attribute__ does not exist in Visual Studio. Therefore replaced wherever it appeared with a macro:
Redefines MDB_DEPRECATED to support Visual Studio
Define a Constructor MACRO so that __attribute__((constructor/destructor)) behavior is achieved in Visual Studio.

Just using generate_table_schema through mdb_print_schema deletes the purpose of a very good tool. generate_table_schemas is a rewrite of generate_table_schema but sends the data to a char* instead of FILE*. There is NO fmemopen() or similar in Visual Studio, so there is NO way to access memory through a FILE* except for first writing to the disk and then reading from the disk in memory.

I cannot suggest how to handle the case when td == 0 for the dates. The databases I work with often have just 00:00:00 in the DateTime column which is not consistent with the rest of the column either, but I have to deal with it somehow.

Leaving void* where char* is needed as a function parameter returns a compilation error in Visual Studio.
2013-01-14 19:27:53 +01:00
Nirgal Vourgère
a972c1638d merge with master 2013-01-14 14:20:10 +01:00
Nirgal Vourgère
eeadcb54f3 Use macros for depreacated function attributes
This will help porting on compilers that don't support it
2013-01-13 23:50:42 +01:00
Jimmytaker
c9f602480b Code cleanup
Enforce consistency g_malloc - g_free and malloc - free
Move var declarations on top of functions
2013-01-13 23:17:07 +01:00
Jimmytaker
70c6fb7551 Added support for sqlite 2013-01-13 22:32:31 +01:00
Jimmytaker
6df0aa6ce0 Port to Windows and SQLite Extension 2012-12-31 20:40:12 +01:00
Nirgal Vourgère
5f09513c85 Deprecate more mdb_{init|remove}_backends
These functions now use the __attribute__((constructor)) & destructor.
Old names were keep for compatibility

Also put __attribute__((deprecated)) in mdbtools.h for all deprecated
functions.
2012-08-09 14:55:17 +02:00
Will Daniels
04b6cf5232 Export REPID as string & use char(38) in mysql 2012-06-29 02:28:51 +02:00
Nirgal Vourgère
7634e329c7 Renamed namespace into dbnamespace: C++ keyword 2012-02-11 18:38:43 +01:00
Nirgal Vourgre
dd0f4c3819 Patch docs.diff from Nirgal 2011-08-28 19:53:29 -04:00
Nirgal Vourgre
8ef50c444e Patch nosanitize.diff form Nirgal 2011-08-28 18:56:03 -04:00
Nirgal
529534dae5 Oracle numeric types 2011-08-10 18:00:18 -04:00
Nirgal
456f261cab Bunch of fixes for compilation warnings, mostly unused vars. 2011-08-10 18:00:18 -04:00
Brian Bruns
3280842de1 boolean default patch from Nirgal Vourgère 2011-03-20 15:33:26 -04:00