diff --git a/DESCRIPTION b/DESCRIPTION index 0bfd974..f2d61d5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rmodb Title: Metadata-Object pair database -Version: 0.0.1 +Version: 0.1.0 Author: Craig Williams [aut, cre] Maintainer: Craig Williams Description: RMODB implements a metadata-object database for storing R @@ -18,7 +18,7 @@ Encoding: UTF-8 NeedsCompilation: yes LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.0.2 +RoxygenNote: 7.1.1 Suggests: testthat SystemRequirements: libmariadb-client-dev | libmariadb-client-lgpl-dev | libmysqlclient-dev (deb) diff --git a/NAMESPACE b/NAMESPACE index 80e4ad3..eecf407 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,6 +4,7 @@ export(TYPE_BLOB) export(TYPE_BOOL) export(TYPE_DOUBLE) export(TYPE_FLOAT) +export(TYPE_ID) export(TYPE_INT16) export(TYPE_INT32) export(TYPE_INT64) @@ -15,6 +16,23 @@ export(TYPE_UINT16) export(TYPE_UINT32) export(TYPE_UINT64) export(TYPE_UINT8) +export(group) +export(group_create) +export(group_delete) +export(group_exists) +export(group_id) +export(groups) +export(link_user_group) +export(metadata) +export(metadata_query) +export(metadatas) +export(metaobject) +export(metaobject_create) +export(metaobject_delete) +export(metaobject_ids) +export(metaobject_query) +export(metaobject_update) +export(metaobjects) export(modb_conn_ref) export(modb_connect) export(modb_connectionExists) @@ -26,4 +44,14 @@ export(modb_destroy) export(modb_disconnect) export(modb_exists) export(modb_use) +export(object) +export(object_query) +export(objects) +export(unlink_user_group) +export(user) +export(user_create) +export(user_delete) +export(user_exists) +export(user_id) +export(users) useDynLib(rmodb, .registration = TRUE, .fixes = "c_") diff --git a/man/modb_conn_ref.Rd b/man/modb_conn_ref.Rd index 181d63c..4abd3b1 100644 --- a/man/modb_conn_ref.Rd +++ b/man/modb_conn_ref.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/Manage.R +% Please edit documentation in R/Database.R \name{modb_conn_ref} \alias{modb_conn_ref} \title{MODB Connection References} diff --git a/man/modb_connect.Rd b/man/modb_connect.Rd index b4c0ed9..d947a45 100644 --- a/man/modb_connect.Rd +++ b/man/modb_connect.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/Manage.R +% Please edit documentation in R/Database.R \name{modb_connect} \alias{modb_connect} \title{MODB Connections} diff --git a/man/modb_connectionInfo.Rd b/man/modb_connectionInfo.Rd index fe786cf..8851450 100644 --- a/man/modb_connectionInfo.Rd +++ b/man/modb_connectionInfo.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/Manage.R +% Please edit documentation in R/Database.R \name{modb_connectionInfo} \alias{modb_connectionInfo} \alias{modb_connectionExists} diff --git a/man/modb_disconnect.Rd b/man/modb_disconnect.Rd index ae2530e..df3a690 100644 --- a/man/modb_disconnect.Rd +++ b/man/modb_disconnect.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/Manage.R +% Please edit documentation in R/Database.R \name{modb_disconnect} \alias{modb_disconnect} \title{MODB Connections} diff --git a/src/Makevars.in b/src/Makevars.in index 0279ecb..90b9c7a 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -1,10 +1,12 @@ -PKG_CPPFLAGS=@cflags@ +PKG_CPPFLAGS=@cflags@ -DDEBUG -DSQL_DEBUG_MAX_LEN=2048 PKG_LIBS=@libs@ all: clean clean: rm -f $(SHLIB) $(OBJECTS) + +#OBJECTS = $(patsubst %.c,%.o,$(wildcard *.c)) OBJECTS = $(DB_OBJECTS) $(MODB_OBJECTS) $(R_OBJECTS) strext.o DB_OBJECTS = $(patsubst %.c,%.o,$(wildcard db_*.c)) MODB_OBJECTS = $(patsubst %.c,%.o,$(wildcard modb_*.c)) diff --git a/src/db_value.c b/src/db_value.c index a76bd33..03914c8 100644 --- a/src/db_value.c +++ b/src/db_value.c @@ -70,7 +70,7 @@ void db_value_sbva(str_builder *sb, e_column_type type, uint32_t n_args, va_list } if (type == TYPE_TIMESTAMP) { - if (db_timestampString(va_arg(args, unsigned int), &tmp_str, &tmp_len) == 0) { + if (db_timestampString(va_arg(args, int64_t), &tmp_str, &tmp_len) != 0) { strbld_str(sb, tmp_str, tmp_len); free(tmp_str); } diff --git a/src/initR.c b/src/initR.c index 5e52c4f..38f3ded 100644 --- a/src/initR.c +++ b/src/initR.c @@ -18,6 +18,8 @@ static const R_CallMethodDef callMethods[] = { {"rmodb_use", (DL_FUNC) &rmodb_use, 3}, + {"rmodb_getLastQuery", (DL_FUNC) &rmodb_getLastQuery, 1}, + {"rmodb_groupId", (DL_FUNC) &rmodb_groupId, 2}, @@ -41,7 +43,9 @@ static const R_CallMethodDef callMethods[] = { {"rmodb_userRemoveGroup", (DL_FUNC) &rmodb_userRemoveGroup, 3}, - {"rmodb_metaobjectId", (DL_FUNC) &rmodb_metaobjectId, 2}, + {"rmodb_metaobjectIds", (DL_FUNC) &rmodb_metaobjectIds, 3}, + {"rmodb_metaobjectQuery", (DL_FUNC) &rmodb_metaobjectQuery, 4}, + {"rmodb_metadataQuery", (DL_FUNC) &rmodb_metadataQuery, 4}, {"rmodb_metaobject", (DL_FUNC) &rmodb_metaobject, 2}, {"rmodb_metadata", (DL_FUNC) &rmodb_metadata, 2}, @@ -51,7 +55,7 @@ static const R_CallMethodDef callMethods[] = { {"rmodb_metadatas", (DL_FUNC) &rmodb_metadatas, 2}, {"rmodb_createMetaobject", (DL_FUNC) &rmodb_createMetaobject, 5}, - {"rmodb_updateMetaobject", (DL_FUNC) &rmodb_updateMetaobject, 3}, + {"rmodb_updateMetaobject", (DL_FUNC) &rmodb_updateMetaobject, 5}, {"rmodb_deleteMetaobject", (DL_FUNC) &rmodb_deleteMetaobject, 2},