]> gitweb.factorcode.org Git - factor.git/commitdiff
add create-index
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 13 Jun 2008 06:17:10 +0000 (01:17 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 13 Jun 2008 06:17:10 +0000 (01:17 -0500)
extra/db/queries/queries.factor

index 807aeda74a7f62af520e3ed17855e09ce8e3bd3c..5c3f3e13e6066f639055bedde0a53d250da2d553 100644 (file)
@@ -195,3 +195,12 @@ M: db <count-statement> ( tuple class groups -- statement )
     ] { { } { } { } } nmake
     >r >r parse-sql 4drop r> r>
     <simple-statement> maybe-make-retryable do-select ;
+
+: create-index ( index-name table-name columns -- )
+    [
+        >r >r "create index " % % r> " on " % % r> "(" %
+        "," join % ")" %
+    ] "" make sql-command ;
+
+: drop-index ( index-name -- )
+    [ "drop index " % % ] "" make sql-command ;