Exemple #1
0
    def query_all(self, limit=10, ret_t=False):
        cur = self.db_idx.no_component(limit=limit)
        if cur:
            if ret_t:
                ll = [(guid_bin_to_hex2(t[0]), t[1], t[2], t[3], t[4]) for t in cur.fetchall()]
                return ll

            else:
                ll = [guid_bin_to_hex2(t[0]) for t in cur.fetchall()]
                return ll
Exemple #2
0
    def query_all(self, limit=10, quantified=False):
        cur = self.idx_store.no_component(limit=limit)
        if cur:
            if quantified:
                ll = [(guid_bin_to_hex2(t[0]), t[1], t[2], t[3], t[4])
                      for t in cur.fetchall()]
                return ll

            else:
                ll = [guid_bin_to_hex2(t[0]) for t in cur.fetchall()]
                return ll
Exemple #3
0
    def query_terms_d(self, terms_d: dict, limit=1000, quantified=False):
        # todo hard limit in config or remove
        cur = self.idx.qry_terms_d(terms_d, limit=limit)
        if cur:
            if quantified:
                ll = [(guid_bin_to_hex2(t[0]), t[1], t[2], t[3], t[4])
                      for t in cur.fetchall()]
                return ll

            l1 = list(cur.fetchall())
            ll = [guid_bin_to_hex2(t[0]) for t in l1]
            return ll
Exemple #4
0
 def query_terms(self,
                 terms: dict,
                 prefixes=True,
                 limit=30,
                 quantified=False):
     cur = self.idx.qry_terms(terms=terms, prefixes=prefixes, limit=limit)
     if cur:
         if quantified:
             ll = [(guid_bin_to_hex2(t[0]), t[1], t[2], t[3], t[4])
                   for t in cur.fetchall()]
             return ll
         ll = [guid_bin_to_hex2(t[0]) for t in cur.fetchall()]
         return ll
Exemple #5
0
 def query_terms_d(self, terms_d: dict, limit=30):
     # print("\n\nQUERY_TERMS_D", terms_d)
     cur = self.idx.qry_terms_d(terms_d, limit=limit)
     if cur:
         # print(list(cur.fetchall()))
         # ll = None
         l1 = list(cur.fetchall())
         # print('---->', l1)
         ll = [guid_bin_to_hex2(t[0]) for t in l1]
         return ll
Exemple #6
0
 def query_terms(self, terms: dict, prefixes=True, limit=30):
     cur = self.idx.qry_terms(terms=terms, prefixes=prefixes, limit=limit)
     if cur:
         ll = [guid_bin_to_hex2(t[0]) for t in cur.fetchall()]
         return ll
Exemple #7
0
 def query_terms_d(self, terms_d: dict):
     cur = self.idx.qry_terms_d(terms_d)
     if cur:
         ll = [guid_bin_to_hex2(t[2]) for t in cur.fetchall()]
         return ll
Exemple #8
0
 def query_all(self):
     cur = self.db_idx.no_component()
     if cur:
         ll = [guid_bin_to_hex2(t[2]) for t in cur.fetchall()]
         return ll