maria-discuss team mailing list archive
-
maria-discuss team
-
Mailing list archive
-
Message #00723
Re: mariasql client question (zappajs, coffeescript, nodejs)
-
To:
klrumpf <klrumpf@xxxxxxxxx>
-
From:
Kristian Nielsen <knielsen@xxxxxxxxxxxxxxx>
-
Date:
Tue, 05 Feb 2013 14:28:48 +0100
-
Cc:
mariadb <"maria-discuss"@lists.launchpad.net>
-
In-reply-to:
<510FE293.5060100@gmail.com> (klrumpf@gmail.com's message of "Mon, 04 Feb 2013 17:32:19 +0100")
-
User-agent:
Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
klrumpf <klrumpf@xxxxxxxxx> writes:
> I now want to switch to the mariasql client...
Cool, that is an interesting project ...
> res.on("row", (row) ->
> console.log "Result row: " + inspect(row)
> @get '/': (req,res) -> # LANDING PAGE)
> result = doSql("select pakz from pkt where pktnr=10001")
> console.log "919, result = ",result
> Console log in the doSql functions shows the results correctly but I
> have been
> playing around for a while and I can't get the function to return the
> result for
> further processing to the @get routine. Seems like I have not understood
I assume you mean that
- You get output linis with "Result row: ..."
- You get no line "919, result = ", or it is empty.
Unfortunately, there may not be many on this list who are familiar with
node.js.
I have only general knowledge about event-driven programming. This leads me to
think that you need to pass a handler to your doSql() function and invoke this
handler in your res.on() handler. But I frankly admit I do not know if
something else could work with node.js.
> Thanks, hope this is the right list for this, Karl
You are welcome to try :-). Maybe someone with knowledge of node.js will
answer. But it might not be the best list, your problem looks more related to
general node.js than to MariaDB.
Hope this helps (a little),
- Kristian.
Follow ups
References