nakagami / firebirdsql

Firebird RDBMS sql driver for Go (golang)
MIT License
227 stars 60 forks source link

Using "github.com/jmoiron/sqlx" #32

Closed everton-sales-branco closed 5 years ago

everton-sales-branco commented 8 years ago

I'm trying to use the library "github.com/jmoiron/sqlx", but returns nothing. There is a known incompatibility?

nakagami commented 7 years ago

I don't know.

I will try later.

nakagami commented 5 years ago

Example code does not work. https://gist.github.com/nakagami/4f6c0693b3793d3ebd6918efeab1100a

I hope to support sqlx.

nakagami commented 5 years ago

I'm add column_name_to_uppper parameter to driver.

And example code seems good work. https://gist.github.com/nakagami/4f6c0693b3793d3ebd6918efeab1100a/revisions#diff-9edf3c0a6ae578d191deef888bec08f6L40

Have another problem with sqlx ? I hope someones test.

eztEgyed commented 2 years ago

Why must the first letter of the structure variable be capitalised?

This works: type Place struct { Country string City sql.NullString TelCode int }

But, when rename "Country " to "country", then not:

type Place struct { country string City sql.NullString TelCode int }

It gives : "missing destination name country in *[]main.Place" error.

ajoses commented 2 years ago

Hi @eztEgyed,

This is how Go works, here is a example that explain

https://tour.golang.org/basics/3

In summary, for Go if the first letter is capitalized is exported, if is not capitalized is only visible in the package