Commit 1b1314d8 authored by Rinus Plasmeijer's avatar Rinus Plasmeijer
Browse files

*** empty log message ***

parent e02a4bae
...@@ -486,19 +486,21 @@ where ...@@ -486,19 +486,21 @@ where
(GerdaFunctions _ layoutK _ _) = gerdaInt [SqlPrimary] (GerdaFunctions _ layoutK _ _) = gerdaInt [SqlPrimary]
removeTable :: !String !*Gerda -> *Gerda removeTable :: !String !*Gerda -> *Gerda
removeTable tableName g=:{layout, connection, state} removeTable name g=:{layout, connection, state}
# (r, h, state) = SQLAllocHandle SQL_HANDLE_STMT connection state # (r, h, state) = SQLAllocHandle SQL_HANDLE_STMT connection state
| r <> SQL_SUCCESS = abort "SQLAllocHandle SQL_HANDLE_STMT failed" | r <> SQL_SUCCESS = abort "SQLAllocHandle SQL_HANDLE_STMT failed"
# drop = "DROP TABLE " +++ sqlEscape ("*" +++ tableName) # drop = "DROP TABLE " +++ sqlEscape tableName
(r, state) = SQLExecDirect h (TRACE_SQL drop) (size drop) state (r, state) = SQLExecDirect h (TRACE_SQL drop) (size drop) state
// | r <> SQL_SUCCESS = abort ("SQLExecDirect failed " +++ drop) // | r <> SQL_SUCCESS = abort ("SQLExecDirect failed " +++ drop)
# (r, state) = SQLFreeHandle SQL_HANDLE_STMT h state # (r, state) = SQLFreeHandle SQL_HANDLE_STMT h state
| r <> SQL_SUCCESS = abort "SQLFreeHandle SQL_HANDLE_STMT failed" | r <> SQL_SUCCESS = abort "SQLFreeHandle SQL_HANDLE_STMT failed"
# (m, layout) = extractTable ("*" +++ tableName) layout # (m, layout) = extractTable tableName layout
g = {g & layout = layout, state = state} g = {g & layout = layout, state = state}
= case m of = case m of
Just table -> closeTable table g Just table -> closeTable table g
_ -> g _ -> g
where
tableName = "*" +++ name
writeToTable :: !String ![Table] !(GerdaWrite a) a !*Gerda -> (!Int, !*Gerda) writeToTable :: !String ![Table] !(GerdaWrite a) a !*Gerda -> (!Int, !*Gerda)
writeToTable tableName tables write x g writeToTable tableName tables write x g
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment