diff options
author | Gabor X Toth <*@tg-x.net> | 2015-05-07 12:15:58 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2015-05-07 12:15:58 +0000 |
commit | 4725d59b468f1f30ba2910992333ca157682ce29 (patch) | |
tree | 23715ee20879c94a3363e28ea184370a4a71e44d /src/psycstore/plugin_psycstore_sqlite.c | |
parent | a5edf8ac9f03a368c87ea6163994d4ac3d62af06 (diff) | |
download | gnunet-4725d59b468f1f30ba2910992333ca157682ce29.tar.gz gnunet-4725d59b468f1f30ba2910992333ca157682ce29.zip |
psyc/social: request history & state from psycstore; more documentation, tests, cleanup
Diffstat (limited to 'src/psycstore/plugin_psycstore_sqlite.c')
-rw-r--r-- | src/psycstore/plugin_psycstore_sqlite.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/psycstore/plugin_psycstore_sqlite.c b/src/psycstore/plugin_psycstore_sqlite.c index 04bec6809..542c4bfc9 100644 --- a/src/psycstore/plugin_psycstore_sqlite.c +++ b/src/psycstore/plugin_psycstore_sqlite.c | |||
@@ -376,6 +376,7 @@ database_setup (struct Plugin *plugin) | |||
376 | "CREATE INDEX IF NOT EXISTS idx_membership_channel_id_slave_id " | 376 | "CREATE INDEX IF NOT EXISTS idx_membership_channel_id_slave_id " |
377 | "ON membership (channel_id, slave_id);"); | 377 | "ON membership (channel_id, slave_id);"); |
378 | 378 | ||
379 | /** @todo messages table: add method_name column */ | ||
379 | sql_exec (plugin->dbh, | 380 | sql_exec (plugin->dbh, |
380 | "CREATE TABLE IF NOT EXISTS messages (\n" | 381 | "CREATE TABLE IF NOT EXISTS messages (\n" |
381 | " channel_id INTEGER NOT NULL REFERENCES channels(id),\n" | 382 | " channel_id INTEGER NOT NULL REFERENCES channels(id),\n" |
@@ -468,6 +469,7 @@ database_setup (struct Plugin *plugin) | |||
468 | " AND ? <= fragment_id AND fragment_id <= ?;", | 469 | " AND ? <= fragment_id AND fragment_id <= ?;", |
469 | &plugin->select_fragments); | 470 | &plugin->select_fragments); |
470 | 471 | ||
472 | /** @todo select_messages: add method_prefix filter */ | ||
471 | sql_prepare (plugin->dbh, | 473 | sql_prepare (plugin->dbh, |
472 | "SELECT hop_counter, signature, purpose, fragment_id,\n" | 474 | "SELECT hop_counter, signature, purpose, fragment_id,\n" |
473 | " fragment_offset, message_id, group_generation,\n" | 475 | " fragment_offset, message_id, group_generation,\n" |
@@ -489,6 +491,7 @@ database_setup (struct Plugin *plugin) | |||
489 | "ORDER BY fragment_id;", | 491 | "ORDER BY fragment_id;", |
490 | &plugin->select_latest_fragments); | 492 | &plugin->select_latest_fragments); |
491 | 493 | ||
494 | /** @todo select_latest_messages: add method_prefix filter */ | ||
492 | sql_prepare (plugin->dbh, | 495 | sql_prepare (plugin->dbh, |
493 | "SELECT hop_counter, signature, purpose, fragment_id,\n" | 496 | "SELECT hop_counter, signature, purpose, fragment_id,\n" |
494 | " fragment_offset, message_id, group_generation,\n" | 497 | " fragment_offset, message_id, group_generation,\n" |
@@ -499,6 +502,7 @@ database_setup (struct Plugin *plugin) | |||
499 | " (SELECT message_id\n" | 502 | " (SELECT message_id\n" |
500 | " FROM messages\n" | 503 | " FROM messages\n" |
501 | " WHERE channel_id = (SELECT id FROM channels WHERE pub_key = ?)\n" | 504 | " WHERE channel_id = (SELECT id FROM channels WHERE pub_key = ?)\n" |
505 | " GROUP BY message_id\n" | ||
502 | " ORDER BY message_id\n" | 506 | " ORDER BY message_id\n" |
503 | " DESC LIMIT ?)\n" | 507 | " DESC LIMIT ?)\n" |
504 | "ORDER BY fragment_id;", | 508 | "ORDER BY fragment_id;", |