diff options
author | Martin Willi <martin@strongswan.org> | 2008-07-21 11:13:06 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2008-07-21 11:13:06 +0000 |
commit | fc861b0b7edcc80defe6053791ef8eb8147ab967 (patch) | |
tree | 627636164e3dcaa1dcc0e0c3be8c6f80b783b140 /src/libstrongswan/database | |
parent | a4a3e0c7dcb475cb7e7fe73e974a7e9a9aaca1fa (diff) | |
download | strongswan-fc861b0b7edcc80defe6053791ef8eb8147ab967.tar.bz2 strongswan-fc861b0b7edcc80defe6053791ef8eb8147ab967.tar.xz |
added a driver type getter for database implementations
Diffstat (limited to 'src/libstrongswan/database')
-rw-r--r-- | src/libstrongswan/database/database.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libstrongswan/database/database.h b/src/libstrongswan/database/database.h index 1cf5c2542..39f909cd7 100644 --- a/src/libstrongswan/database/database.h +++ b/src/libstrongswan/database/database.h @@ -22,6 +22,7 @@ #define DATABASE_H_ typedef enum db_type_t db_type_t; +typedef enum db_driver_t db_driver_t; typedef struct database_t database_t; #include <utils/enumerator.h> @@ -44,6 +45,15 @@ enum db_type_t { DB_NULL, }; +/** + * Database implementation type. + */ +enum db_driver_t { + /** SQLite database */ + DB_SQLITE, + /** MySQL database */ + DB_MYSQL, +}; /** * Interface for a database implementation. @@ -95,6 +105,16 @@ struct database_t { int (*execute)(database_t *this, int *rowid, char *sql, ...); /** + * Get the database implementation type. + * + * To allow driver specific SQL or performance optimizations each database + * implementations can be queried for its type. + * + * @return database implementation type + */ + db_driver_t (*get_driver)(database_t *this); + + /** * Destroy a database connection. */ void (*destroy)(database_t *this); |