Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding Javascript functionality from the 'js' app.

  • Loading branch information...
commit f20990172dbcc2a84cd8a5049bb97a4faa9583f1 1 parent a89cabb
etnt authored
View
12 lib/ysql/README
@@ -7,6 +7,13 @@ to do various operations towards a SQL database.
So far it has only been tested towards MySQL (4.0.24).
+Initially, the idea was to learn more about how to
+work towards MySQL from Erlang and Yaws. But from
+version 0.2 we have also started to explore how we
+can use the Javascript support in the the 'js'
+application.
+
+
Installation
------------
@@ -28,10 +35,11 @@ or install it from jungerl.
Then modify your yaws.conf file:
-1. If you run from jungerl, then add the ebin directory to
- your yaws.conf file:
+1. If you run from jungerl, then add the ebin directories
+ to 'ysql' and 'js' in your yaws.conf file:
ebin_dir = /home/tobbe/jungerl/lib/ysql/ebin
+ ebin_dir = /home/tobbe/jungerl/lib/js/ebin
2. Create a server entry and point out the docroot.
Example:
View
1  lib/ysql/src/ysql.app.src
@@ -10,5 +10,6 @@
[{kernel, "2.9.6"},
{stdlib, "1.12.7"},
{odbc, "2.0.4"},
+ {js, "0.1"},
{sasl,"1.10.1"}]}]}.
View
7 lib/ysql/src/ysql.erl
@@ -17,7 +17,7 @@
%% External exports
-export([start_link/0, start/0, odbc_connect/3, top/1, lk/2, lk/3, date/0,
use/2, desc_table/2, selected/1, where/1, select/3, select/4,
- db/1, table/1, logout/1, sql_query/2]).
+ db/1, table/1, logout/1, sql_query/2, clock/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
@@ -30,6 +30,11 @@
%% External functions
%%====================================================================
+clock() ->
+ js:periodically_call_remote_S([{update, "the_clock"},
+ {frequency, "1"},
+ {url, "/clock.yaws" }]).
+
selected(L) ->
F = fun({"x_"++Selected, "on"}, Acc) -> [Selected | Acc];
(_, Acc) -> Acc
View
2  lib/ysql/vsn.mk
@@ -1 +1 @@
-YSQL_VSN=0.1
+YSQL_VSN=0.2
Please sign in to comment.
Something went wrong with that request. Please try again.