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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -