-
Notifications
You must be signed in to change notification settings - Fork 72
Description
Referring to these docs https://github.com/blue-jay/blueprint/wiki/Use-Gorm-with-Blueprint
Under Example Model you have:
database "github.com/blue-jay/blueprint/lib/gorm"
I assume you downloaded the gorm project and its pointing to it
In the example code for gorm and mysql they point to a more specific point
"github.com/jinzhu/gorm/dialects/mysql"
the mysql.go only has one import
github.com/go-sql-driver/mysql
Now my understanding of an import alias is that some function has the name your looking for, in this case its database.SQL. so its looking for SQL and cannot find it, I did find it in the driver file, but it states its undefined.
It would be nice to get this working, not sure what I am doing wrong, new to go and could not find an example that helped.
Update:
Adding this:
var (
// SQL wrapper
SQL *database.DB
)
I fixed the calls by adding db *database.DB, to both ByEmail and Create and faked the returns, but you use flight and that is where I am stuck is how to make sqlx and gorm work together
so I change them out type *sqlx.DB as type *gorm.DB
Notes and Registry needs updating:
I want to convert the whole project so I can use what ever database I want, SQLite for now, most people want a choice, if your going to document something it should work, if you want your project to use gorm is your decision, but the options for others to use it will increase your ranking and make this project more popular because it will be more flexible, you can add what type of database to use in the config file, then this app would really rock.
Making progress: do you have a working example of this?
Thanks