Collection of changes (mostly to db source)

- Replaced string malloc()... calls with strmemcpy() from strext.h where appropriate
- Added table name to column struct (useful for WHERE's)
- Changed the column type enum to powers of 2 (potential for NULLABLE flag  by or'ing)
- Added last_qry and num_queries to connection struct
- Fixed destruct tables stopping on error
- Renamed owners to users except in the meta table
- Fixed the 'tableExists' query
This commit is contained in:
2020-10-02 12:46:21 +01:00
parent 6c8bab8da6
commit cb9361fcc9
9 changed files with 108 additions and 94 deletions

View File

@@ -14,9 +14,9 @@
#define OBJECTS_TABLE "_objects"
#define MDO_GROUPS_TABLE "_mdo_groups"
#define OWNERS_TABLE "_owner"
#define USERS_TABLE "_users"
#define GROUPS_TABLE "_groups"
#define OWNER_GROUPS_TABLE "_owner_groups"
#define USER_GROUPS_TABLE "_user_groups"
#define META_EXT_TABLE "_meta_ext"
@@ -26,9 +26,9 @@ uint64_t createMetaTable(struct stored_conn_t *sconn, struct modb_t *modb);
uint64_t createObjectsTable(struct stored_conn_t *sconn, struct modb_t *modb);
uint64_t createMDOGroupsTable(struct stored_conn_t *sconn, struct modb_t *modb);
uint64_t createOwnersTable(struct stored_conn_t *sconn, struct modb_t *modb);
uint64_t createUsersTable(struct stored_conn_t *sconn, struct modb_t *modb);
uint64_t createGroupsTable(struct stored_conn_t *sconn, struct modb_t *modb);
uint64_t createOwnerGroupsTable(struct stored_conn_t *sconn, struct modb_t *modb);
uint64_t createUserGroupsTable(struct stored_conn_t *sconn, struct modb_t *modb);
int tableExists(struct stored_conn_t *sconn, struct modb_t *modb,
const char *suffix, size_t suffix_len);