[Groonga-commit] groonga/groonga-admin at f5e375a [master] Convert "schema" response's table to schema object's table

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Sep 21 17:09:35 JST 2016


YUKI Hiroshi	2016-09-21 17:09:35 +0900 (Wed, 21 Sep 2016)

  New Revision: f5e375aeee1a39218df4f1700e8b16f2aa27fe57
  https://github.com/groonga/groonga-admin/commit/f5e375aeee1a39218df4f1700e8b16f2aa27fe57

  Merged eebf840: Merge pull request #10 from groonga/features/migrate-table_list-to-schema

  Message:
    Convert "schema" response's table to schema object's table

  Modified files:
    app/scripts/services/schema-loader.js

  Modified: app/scripts/services/schema-loader.js (+28 -1)
===================================================================
--- app/scripts/services/schema-loader.js    2016-09-21 16:32:27 +0900 (9e0a75d)
+++ app/scripts/services/schema-loader.js    2016-09-21 17:09:35 +0900 (3a574d9)
@@ -97,12 +97,39 @@ angular.module('groongaAdminApp')
 
       function buildTable(rawTable) {
         var table = {};
-        if (table.key_type) {
+        table.id           = 0; // XXX it exists in a table_list response but missing in a schema response.
+        table.name         = rawTable.name;
+        table.path         = ''; // XXX it exists in a table_list response but missing in a schema response.
+        table.flags        = [];
+        table.domain       = rawTable.key_type && rawTable.key_type.name;
+        table.range        = rawTable.value_type && rawTable.value_type.name
+        table.tokenizer    = rawTable.tokenizer && rawTable.tokenizer.name;
+        table.normalizer   = rawTable.normalizer && rawTable.normalizer.name;
+        table.tokenFilters = '';
+        table.type         = rawTable.type;
+        table.keyType      = null;
+
+        if (rawTable.command &&
+            rawTable.command.arguments &&
+            rawTable.command.arguments.flags)
+          table.flags = rawTable.command.arguments.flags.split('|');
+
+        if (rawTable.token_filters)
+          table.tokenFilters = rawTable.token_filters.join('|'); // XXX what is the correct delimiter?
+
+        if (rawTable.key_type) {
           table.keyType = {
             name: rawTable.key_type.name,
             isTextType: isTextType(rawTable.key_type.name)
           };
         }
+
+        table.isArray           = table.type == 'array';
+        table.isHashTable       = table.type == 'hash table';
+        table.isPatriciaTrie    = table.type == 'patricia trie';
+        table.isDoubleArrayTrie = table.type == 'double attay trie';
+        table.hasKey            = !table.isArray;
+
         return table;
       }
 
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index