From c9213b0b72a944f175b536e687a6c9d358d9f7c6 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 1 Jun 2018 11:44:11 +0200 Subject: [PATCH] set pipe concat mode when using mysql --- pkg/datastore/sqlstore/sqlstore.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/datastore/sqlstore/sqlstore.go b/pkg/datastore/sqlstore/sqlstore.go index b77a98c..4e121ad 100644 --- a/pkg/datastore/sqlstore/sqlstore.go +++ b/pkg/datastore/sqlstore/sqlstore.go @@ -29,6 +29,12 @@ func New(c *Config) *sqlstore { // write log statement log.Infof("Connected to %s database: %s", c.Driver, c.Name) + // Driver specific database options + if c.Driver == "mysql" { + // Because SQLite doesn't have CONCAT, tell MySQL to accept pipes for concatenating string columns + db.Exec("SET sql_mode=PIPES_AS_CONCAT;") + } + // run migrations db.Migrate()