Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nakagami/firebirdsql
Firebird RDBMS sql driver for Go (golang)
https://github.com/nakagami/firebirdsql
Last synced: about 2 months ago
JSON representation
Firebird RDBMS sql driver for Go (golang)
- Host: GitHub
- URL: https://github.com/nakagami/firebirdsql
- Owner: nakagami
- License: mit
- Created: 2013-08-27T13:09:14.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-05-23T00:39:45.000Z (7 months ago)
- Last Synced: 2024-05-23T00:57:28.136Z (7 months ago)
- Language: Go
- Homepage:
- Size: 719 KB
- Stars: 219
- Watchers: 18
- Forks: 59
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - firebirdsql - Firebird RDBMS SQL driver for Go. (Database Drivers / Relational Database Drivers)
- awesome-go-storage - firebirdsql - Firebird RDBMS SQL driver for Go (Database Drivers)
- awesome-go - firebirdsql - Firebird RDBMS sql driver for Go (golang) - ★ 89 (Database Drivers)
- awesome-go-extra - firebirdsql - 08-27T13:09:14Z|2022-08-23T03:59:02Z| (Generators / Relational Database Drivers)
- awesome-go-storage - firebirdsql - Firebird RDBMS SQL driver for Go (Database Drivers)
README
# firebirdsql (Go firebird sql driver)
Firebird RDBMS https://firebirdsql.org SQL driver for Go
## Requirements
* Firebird 2.5 or higher
* Golang 1.20 or higher## Example
```go
package mainimport (
"fmt"
"database/sql"
_ "github.com/nakagami/firebirdsql"
)func main() {
var n int
conn, _ := sql.Open("firebirdsql", "user:password@servername/foo/bar.fdb")
defer conn.Close()
conn.QueryRow("SELECT Count(*) FROM rdb$relations").Scan(&n)
fmt.Println("Relations count=", n)}
```See also driver_test.go
```go
package mainimport (
"fmt"
"github.com/nakagami/firebirdsql"
)func main() {
dsn := "user:password@servername/foo/bar.fdb"
events := []string{"my_event", "order_created"}
fbEvent, _ := firebirdsql.NewFBEvent(dsn)
defer fbEvent.Close()
sbr, _ := fbEvent.Subscribe(events, func(event firebirdsql.Event) { //or use SubscribeChan
fmt.Printf("event: %s, count: %d, id: %d, remote id:%d \n", event.Name, event.Count, event.ID, event.RemoteID)
})
defer sbr.Unsubscribe()
go func() {
fbEvent.PostEvent(events[0])
fbEvent.PostEvent(events[1])
}()
<- make(chan struct{}) //wait
}
```See also _example
## Connection string
```bash
user:password@servername[:port_number]/database_name_or_file[?params1=value1[¶m2=value2]...]
```### General
- user: login user
- password: login password
- servername: Firebird server's host name or IP address.
- port_number: Port number. default value is 3050.
- database_name_or_file: Database path (or alias name).### Optional
param1, param2... are
| Name | Description | Default | Note |
| --- | --- | --- | --- |
| auth_plugin_name | Authentication plugin name. | Srp256 | Srp256/Srp/Legacy_Auth are available. |
| column_name_to_lower | Force column name to lower | false | For "github.com/jmoiron/sqlx" |
| role | Role name | | |
| timezone | Time Zone name | | For Firebird 4.0+ |
| wire_crypt | Enable wire data encryption or not. | true | For Firebird 3.0+ |
| charset | Firebird Charecter Set | | |## GORM for Firebird
See https://github.com/flylink888/gorm-firebird