# HG changeset patch # User Adam Chlipala # Date 1325192914 18000 # Node ID 1bfd793e7eb89cb11b2c51127834835cb882fac6 # Parent 9253765d772402d6847b7265cf079be469683471 Add dynamic content before running its scripts, to get IDs in scope; fix generation of Postgres queries with blobs diff -r 9253765d7724 -r 1bfd793e7eb8 lib/js/urweb.js --- a/lib/js/urweb.js Thu Dec 29 14:12:03 2011 -0500 +++ b/lib/js/urweb.js Thu Dec 29 16:08:34 2011 -0500 @@ -812,9 +812,9 @@ } else { firstChild = document.createElement("span"); firstChild.innerHTML = html; - runScripts(firstChild); if (x.parentNode) x.parentNode.insertBefore(firstChild, x); + runScripts(firstChild); } }; diff -r 9253765d7724 -r 1bfd793e7eb8 src/postgres.sml --- a/src/postgres.sml Thu Dec 29 14:12:03 2011 -0500 +++ b/src/postgres.sml Thu Dec 29 16:08:34 2011 -0500 @@ -680,7 +680,7 @@ string " };", newline, if List.exists isBlob inputs then - box [string "const int *paramLengths = uw_malloc(ctx, ", + box [string "int *paramLengths = uw_malloc(ctx, ", string (Int.toString (length inputs)), string " * sizeof(int));", newline, @@ -696,7 +696,6 @@ | _ => string "0", string ";", newline]) inputs, - string " };", newline] else box [string "const int *paramLengths = paramFormats;",