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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -