maria-discuss team mailing list archive
Mailing list archive
Re: mariasql client question (zappajs, coffeescript, nodejs)
Kristian Nielsen <knielsen@xxxxxxxxxxxxxxx>
Tue, 05 Feb 2013 14:28:48 +0100
<510FE293.email@example.com> (firstname.lastname@example.org's message of "Mon, 04 Feb 2013 17:32:19 +0100")
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
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),