Lines Matching refs:wdata
727 struct JNPUT_DATA *wdata = work->data; in jn_put_execute() local
728 if (!wdata->patch) { in jn_put_execute()
729 work->rc = jbl_from_json(&jbl, wdata->json); in jn_put_execute()
732 if (wdata->id > 0) { in jn_put_execute()
733 if (wdata->patch) { in jn_put_execute()
734 work->rc = ejdb_patch(jbn->db, wdata->coll, wdata->json, wdata->id); in jn_put_execute()
736 work->rc = ejdb_put(jbn->db, wdata->coll, jbl, wdata->id); in jn_put_execute()
739 work->rc = ejdb_put_new(jbn->db, wdata->coll, jbl, &wdata->id); in jn_put_execute()
753 struct JNPUT_DATA *wdata = work->data; in jn_put_complete() local
754 ns = napi_create_int64(env, wdata->id, &rv); in jn_put_complete()
783 struct JNPUT_DATA *wdata = jn_work_alloc_data(sizeof(*wdata), work, &rc); in jn_put_patch() local
785 wdata->patch = patch; in jn_put_patch()
786 wdata->coll = jn_string(env, argv[0], work->pool, false, true, &rc); in jn_put_patch()
788 wdata->json = jn_string(env, argv[1], work->pool, false, false, &rc); in jn_put_patch()
790 wdata->id = jn_int(env, argv[2], true, true, &rc); in jn_put_patch()
793 if ((wdata->id < 1) && wdata->patch) { in jn_put_patch()
797 …ret = jn_launch_promise(env, info, wdata->patch ? "patch" : "put", jn_put_execute, jn_put_complete… in jn_put_patch()
830 struct JNGET_DATA *wdata = w->data; in jn_get_data_destroy() local
831 if (wdata && wdata->jbl) { in jn_get_data_destroy()
832 jbl_destroy(&wdata->jbl); in jn_get_data_destroy()
843 struct JNGET_DATA *wdata = work->data; in jn_get_execute() local
844 work->rc = ejdb_get(jbn->db, wdata->coll, wdata->id, &wdata->jbl); in jn_get_execute()
853 struct JNGET_DATA *wdata = work->data; in jn_get_complete() local
854 IWXSTR *xstr = iwxstr_new2(jbl_size(wdata->jbl) * 2); in jn_get_complete()
859 work->rc = jbl_as_json(wdata->jbl, jbl_xstr_json_printer, xstr, 0); in jn_get_complete()
893 struct JNGET_DATA *wdata = jn_work_alloc_data(sizeof(*wdata), work, &rc); in jn_get() local
896 wdata->coll = jn_string(env, argv[0], work->pool, false, false, &rc); in jn_get()
898 wdata->id = jn_int(env, argv[1], false, false, &rc); in jn_get()
922 struct JNGET_DATA *wdata = work->data; in jn_del_execute() local
923 work->rc = ejdb_del(jbn->db, wdata->coll, wdata->id); in jn_del_execute()
955 struct JNGET_DATA *wdata = jn_work_alloc_data(sizeof(*wdata), work, &rc); in jn_del() local
957 wdata->coll = jn_string(env, argv[0], work->pool, false, false, &rc); in jn_del()
959 wdata->id = jn_int(env, argv[1], false, false, &rc); in jn_del()
988 struct JNRENAME_DATA *wdata = work->data; in jn_rename_collection_execute() local
989 work->rc = ejdb_rename_collection(jbn->db, wdata->old_name, wdata->new_name); in jn_rename_collection_execute()
1021 struct JNRENAME_DATA *wdata = jn_work_alloc_data(sizeof(*wdata), work, &rc); in jn_rename_collection() local
1024 wdata->old_name = jn_string(env, argv[0], work->pool, false, false, &rc); in jn_rename_collection()
1027 wdata->new_name = jn_string(env, argv[1], work->pool, false, false, &rc); in jn_rename_collection()
1052 struct JNGET_DATA *wdata = work->data; in jn_info_execute() local
1053 work->rc = ejdb_get_meta(jbn->db, &wdata->jbl); in jn_info_execute()
1062 struct JNGET_DATA *wdata = work->data; in jn_info_complete() local
1063 IWXSTR *xstr = iwxstr_new2(jbl_size(wdata->jbl) * 2); in jn_info_complete()
1068 work->rc = jbl_as_json(wdata->jbl, jbl_xstr_json_printer, xstr, 0); in jn_info_complete()
1128 struct JNIDX_DATA *wdata = work->data; in jn_index_execute() local
1129 if (wdata->remove) { in jn_index_execute()
1130 work->rc = ejdb_remove_index(jbn->db, wdata->coll, wdata->path, wdata->mode); in jn_index_execute()
1132 work->rc = ejdb_ensure_index(jbn->db, wdata->coll, wdata->path, wdata->mode); in jn_index_execute()
1165 struct JNIDX_DATA *wdata = jn_work_alloc_data(sizeof(*wdata), work, &rc); in jn_index() local
1167 wdata->coll = jn_string(env, argv[0], work->pool, false, false, &rc); in jn_index()
1169 wdata->path = jn_string(env, argv[1], work->pool, false, false, &rc); in jn_index()
1171 wdata->mode = jn_int(env, argv[2], false, false, &rc); in jn_index()
1173 wdata->remove = jn_bool(env, argv[3], false, false, &rc); in jn_index()
1201 struct JNRMC_DATA *wdata = work->data; in jn_rmcoll_execute() local
1202 work->rc = ejdb_remove_collection(jbn->db, wdata->coll); in jn_rmcoll_execute()
1234 struct JNRMC_DATA *wdata = jn_work_alloc_data(sizeof(*wdata), work, &rc); in jn_rmcoll() local
1236 wdata->coll = jn_string(env, argv, work->pool, false, false, &rc); in jn_rmcoll()
1265 struct JNBK_DATA *wdata = work->data; in jn_online_backup_execute() local
1266 work->rc = ejdb_online_backup(jbn->db, &wdata->ts, wdata->file_name); in jn_online_backup_execute()
1275 struct JNBK_DATA *wdata = work->data; in jn_online_backup_complete() local
1276 ns = napi_create_int64(env, (int64_t) wdata->ts, &rv); in jn_online_backup_complete()
1304 struct JNBK_DATA *wdata = jn_work_alloc_data(sizeof(*wdata), work, &rc); in jn_online_backup() local
1306 wdata->file_name = jn_string(env, argv[0], work->pool, false, true, &rc); in jn_online_backup()