Parcourir la source

Explode dates and symbols.

tags/v1.0^2
Ben Kurtovic il y a 10 ans
Parent
révision
1111afc198
1 fichiers modifiés avec 10 ajouts et 5 suppressions
  1. +10
    -5
      bitshift/database/__init__.py

+ 10
- 5
bitshift/database/__init__.py Voir le fichier

@@ -68,13 +68,18 @@ class Database(object):
# (FTS: author_name) vs. node.name (_Literal)
pass
elif isinstance(node, Date):
# read node.type, node.relation
# (>=/<=: codelet_date_created / codelet_date_modified) vs. node.date (datetime.datetime)
pass
column = {node.CREATE: "codelet_date_created",
node.MODIFY: "codelet_date_modified"}[node.type]
op = {node.BEFORE: "<=", node.AFTER: ">="}[node.relation]
return "(" + column + " " + op + " ?)", [node.date]
elif isinstance(node, Symbol):
tables |= {"symbols"}
# (symbol_type, symbol_name) vs. (node.type, node.name)
pass
if node.type == node.ALL:
# OR all of the types of symbol_types
pass
else:
cond = "(symbol_type = ? AND symbol_name = ?)"
return cond, [node.type, node.name]
elif isinstance(node, BinaryOp):
left_cond, left_args = _parse_node(node.left)
right_cond, right_args = _parse_node(node.right)


Chargement…
Annuler
Enregistrer