go - How do you execute a cql file using gocql? -
if interface directly cassandra using cqlsh following:
$ cqlsh cqlsh:test> source '/home/me/reset_db.cql'
i've tried using gocql several times error. example, running this:
filepath := "/home/me/reset_db.cql" source_file := "source (?)" reseterr := session.query(source_file, filepath).exec()
produces following error:
line 1:0 no viable alternative @ input 'source' ([source]...)
so doing wrong here?
source
shortcut in cqlsh, not valid cql command in general.
you'll need read file contents strings , execute them.
Comments
Post a Comment