Timo Timo - 1 month ago 5
CoffeeScript Question

why does my insert sql query always return undefined?

why does this sql-query always return the row as undefined??

CoffeeScript:

data.get "insert into users (name, password)
values ('#{user.name}', '#{user.password}')", (err, row) ->


thanks.

dmg dmg
Answer

data.get is for queries, not for selects. What is happening is that the statement returns an error.

See this for a tutorial on how to insert tuples:

Intro to Coffee Script and SQLite

Comments