Code

Build a more generic/powerful query API which writes to a store-writer.
[sysdb.git] / src / core / plugin.c
index 8977699..3611be4 100644 (file)
@@ -1437,7 +1437,8 @@ sdb_plugin_fetch_timeseries(const char *type, const char *id,
 } /* sdb_plugin_fetch_timeseries */
 
 int
-sdb_plugin_query(sdb_ast_node_t *ast, sdb_strbuf_t *buf, sdb_strbuf_t *errbuf)
+sdb_plugin_query(sdb_ast_node_t *ast,
+               sdb_store_writer_t *w, sdb_object_t *wd, sdb_strbuf_t *errbuf)
 {
        size_t n = sdb_llist_len(reader_list);
        reader_t *reader;
@@ -1449,8 +1450,7 @@ sdb_plugin_query(sdb_ast_node_t *ast, sdb_strbuf_t *buf, sdb_strbuf_t *errbuf)
 
        if ((ast->type != SDB_AST_TYPE_FETCH)
                        && (ast->type != SDB_AST_TYPE_LIST)
-                       && (ast->type != SDB_AST_TYPE_LOOKUP)
-                       && (ast->type != SDB_AST_TYPE_TIMESERIES)) {
+                       && (ast->type != SDB_AST_TYPE_LOOKUP)) {
                sdb_log(SDB_LOG_ERR, "core: Cannot execute query of type %s",
                                SDB_AST_TYPE_TO_STRING(ast));
                sdb_strbuf_sprintf(errbuf, "Cannot execute query of type %s",
@@ -1472,7 +1472,8 @@ sdb_plugin_query(sdb_ast_node_t *ast, sdb_strbuf_t *buf, sdb_strbuf_t *errbuf)
 
        q = reader->impl.prepare_query(ast, errbuf, reader->r_user_data);
        if (q)
-               status = reader->impl.execute_query(q, buf, errbuf, reader->r_user_data);
+               status = reader->impl.execute_query(q, w, SDB_OBJ(wd),
+                               errbuf, reader->r_user_data);
        else
                status = -1;