-1

I am Looking to import(Rather run the schema.sql and seed.sql) in to the SQL server database using sequel gem. Is it possible with the gem? I did some very basic things like creating a database, running few queries etc. But Can not find any example for importing SQL file.

Thanks j

jnan
  • 23
  • 4
  • 1
    Why do you want to import a large SQL with Ruby instead of directly with a database CLI tool? CLI would probably be faster and would need less memory. – spickermann Sep 25 '20 at 14:55
  • yes, I will do the same. That is a better approach – jnan Sep 25 '20 at 15:30

1 Answers1

1

Sequel doesn't support taking a string/file of multiple SQL statements and running it. You need to provide each SQL statement as a separate query string. Some adapters may allow the submission of multiple SQL statements in a single query string, but it is undefined behavior that depends on which driver is being used.

Jeremy Evans
  • 11,959
  • 27
  • 26