-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add reset function to db backend #62
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,13 @@ struct JBackend | |
JBackendType type; | ||
JBackendComponent component; | ||
|
||
/** | ||
* delete everything in the backend | ||
* \param[in] which namespace to delete | ||
* \param[out] how many "things" are deleted within the specified namespace | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are no in and out parameters in the actual function below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gpointer is an input parameter containing a batch structure, Error is a out parameter, where the error message-string may contain the number of elements which are deleted |
||
*/ | ||
gboolean (*backend_reset)(gpointer, GError**); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this not inside one of the unions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the intention was to have one reset function for all backend types |
||
|
||
union | ||
{ | ||
struct | ||
|
@@ -431,6 +438,7 @@ gboolean j_backend_db_delete (JBackend*, gpointer, gchar const*, bson_t const*, | |
gboolean j_backend_db_query (JBackend*, gpointer, gchar const*, bson_t const*, gpointer*, GError**); | ||
gboolean j_backend_db_iterate (JBackend*, gpointer, bson_t*, GError**); | ||
|
||
gboolean j_backend_reset (JBackend* backend, gpointer, GError**); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above for naming. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the intention was to have one reset function for all backend types |
||
G_END_DECLS | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,8 @@ enum JMessageType | |
J_MESSAGE_DB_INSERT, | ||
J_MESSAGE_DB_UPDATE, | ||
J_MESSAGE_DB_DELETE, | ||
J_MESSAGE_DB_QUERY | ||
J_MESSAGE_DB_QUERY, | ||
J_MESSAGE_RESET | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the intention was to have one reset function for all backend types - that is why there is no DB prefix |
||
}; | ||
|
||
typedef enum JMessageType JMessageType; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,8 @@ gboolean j_db_internal_delete (gchar const* namespace, gchar const* name, bson_t | |
gboolean j_db_internal_query (gchar const* namespace, gchar const* name, bson_t const* selector, gpointer* iterator, JBatch* batch, GError** error); | ||
gboolean j_db_internal_iterate (gpointer iterator, bson_t* metadata, GError** error); | ||
|
||
gboolean j_internal_reset (gchar const* namespace, JBatch* batch, GError** error); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the intention was to have one reset function for all backend types - maybe this should be moved somewhere in the core if it should be available for all backend types |
||
|
||
// Client-side additional internal functions | ||
bson_t* j_db_selector_get_bson (JDBSelector* selector); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has conflicts, please fix them.