Comments (23)
Waiting for jmoiron/sqlx#406
from pop.
Awesome @stanislas-m I will need some time to make it work since a lot changed in buffalo/pop since March.
from pop.
Completely agree, it just needs someone to step up and implement it. :)
from pop.
Well, I'm interested. Although I probably would need some guidance.
from pop.
Of course! I’m happy to offer guidance. @mclark4386 implemented cockroach support recently. I’m sure he’ll be happy to offer some guidance along the way too!
from pop.
@markbates So I took a glance at the cockroach commits and if I understand correctly the main task would be to implement sqlserver.go and fizz/translators/sqlserver.go similar to mysql/postgres/cockroach. Is that right?
from pop.
That’s the basics of it, yep. I would pick the implementation that’s closest to MS, I’ve never used it, and use that as a starting point. Rename a few things, point them at the MS DB and see what the tests yell at you about.
from pop.
@markbates hmm... travis doesn't support ms sql server. would you consider to add appveyor integration?
https://www.appveyor.com/
from pop.
from pop.
@markbates true - i've found this: https://github.com/aspnet/EntityFrameworkCore/pull/7842/files
I'll go with travis then.
from pop.
@marpio happy to help if you have questions! Sounds like you have a good start going.
from pop.
@markbates short question - what is the purpose of the {db}_meta.go files in the fiz/translators package? Why doesn't postgres need it?
from pop.
Some of the translators, like SQLite (for example), need additional meta information about the table(s), indexes, etc… to create the proper sql for things such as renaming a column.
Postgres is a nice db and things just work. :)
from pop.
@markbates thanks
from pop.
I'm having some difficulties - sqlx doesn't support the sqlserver parameter syntax so:
// this doesn't work
tx.MustExec("INSERT INTO person (first_name, last_name, email) VALUES ($1, $2, $3)", "Jason", "Moiron", "[email protected]")
// this works
tx.MustExec("INSERT INTO person (first_name, last_name, email) VALUES (@p1, @p2, @p3)", "Jason", "Moiron", "[email protected]")
// but this doesn't
tx.NamedExec("INSERT INTO person (first_name, last_name, email) VALUES (:first_name, :last_name, :email)", &Person{"Jane", "Citizen", "[email protected]"})
// neither does this
tx.NamedExec("INSERT INTO person (first_name, last_name, email) VALUES (@first_name, @last_name, @email)", &Person{"Jane", "Citizen", "[email protected]"})
there is this issue jmoiron/sqlx#374 regarding this problem but it doesn't seem to be active.
The second problem is that sqlserver doesn't support the usual LIMIT and OFFSET syntax so i would need to somehow override the buildPaginationClauses
function...
Any ideas how this could be solved?
from pop.
You probably need to implement your own TranslateSQL function like Postgres does https://github.com/gobuffalo/pop/blob/master/postgresql.go
from pop.
I did that but the problem is, sqlx can not map to the fields in an struct, if i pass the params in form '@field_name' instead of ':field_name' so things like:
tx.NamedExec("INSERT INTO person (first_name, last_name, email) VALUES (@first_name, @last_name, @email)", &Person{"Jane", "Citizen", "[email protected]"})
sqlx does not recognize the '@field_name' and can't bind it.
this doesn't work either:
st, _ := tx.PrepareNamed("INSERT INTO person (first_name, last_name, email) VALUES (@first_name, @last_name, @email)")
st.Exec(&Person{"Jane", "Citizen", "[email protected]"})
from pop.
@marpio jmoiron/sqlx#406 was merged, and I just merged your PR in fizz. :)
from pop.
No problem, take your time!
from pop.
@marpio any update on this?
from pop.
@Norris1z
I'm quite busy these days and not sure when I get to it. Probably in 2-3 months. Sorry for that. Feel free to take this one if you're interested!
from pop.
I'm interesting in this. I'm a little green when it comes to Go, and would want to chat about what the scope of work looks like before volunteering to take this on. Gopher slack the best place for that?
from pop.
@andyedison Sure, feel free to join the buffalo-dev
channel on Gopher slack. :)
from pop.
Related Issues (20)
- milestone v6.z.0
- milestone v6.x.0
- project clean up HOT 3
- proposal: improve handling positional parameters in `WHERE`
- fix regex bug on the `WHERE col IN (?)`
- Empty postgres array loaded as slice with one item HOT 4
- feature proposal: add support to oracle DB HOT 1
- bug: transaction panic recovery swallows panic message HOT 3
- feature: log transaction/connection ID to track SQL executions for a request
- feature: Read/Write routing to different endpoints HOT 2
- feature: improve performance if the element of the Value of *Model does not implement the AfterFindable interface. HOT 4
- bug: DB connection locks up under load calling DB.Create(), regression in 6.1.0 vs 6.0.8 HOT 8
- feature: parallelize association loading HOT 2
- process: update supported database versions
- bug: sqlite3 testing on Windows + go 1.17 failing sometimes HOT 3
- bug: incorrect error handling
- Need a way to update stale pop connecton configs before pop reconnections a failed connectionfeature: HOT 6
- feature: upgrade jackc/pgx to v5 HOT 2
- feature: Dialect for Cassandra HOT 3
- feature: DB connection timeout HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pop.