Using raw db connection for creating object #721
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#721
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi Xorm team,
Firstly thanks for writing this awesome ORM tool! Golang is still in its initial stages so its good to see some mature code out there!
I am using Google's Cloud offering and they have a CloudSql proxy (which talks mysql internally). Although since your constructor does not take an actual db object (and say that it's SQL) I cannot use xorm unless I deconstruct either yours or cloudsql proxy code.
This is how I currently instantiate an object in my code:
config.Addr = instanceName config.User = dbUser config.Passwd = dbPass config.DBName = dbName db, err = cloudsqldialer.DialCfg(&config)
The code for cloudsql is here: github.com/GoogleCloudPlatform/cloudsql-proxy
Any help appreciated
I think maybe you can copy mysql dialect and change something to do that. XORM needs to know the SQL syntax which you are using, MySQL or Postgres. So a raw *DB is not enough. But if XORM know the raw *DB and the it's MySQL syntax it will work. But it also has some work to do.