xata go
1.0.0

xata.io 데이터베이스를위한 간단한 Golang 클라이언트.
XATA는 스프레드 시트만큼 사용하기 쉬운 서버리스 데이터베이스이며 PostgressQL의 데이터 무결성과 Elasticsearch의 검색 및 분석 기능을 갖습니다.
설치, 실행 :
API 키가 ENV Var : XATA_API_KEY=api-key-value 로 설정되었다고 가정합니다.
package main
import (
"context"
"fmt"
"log"
"github.com/xataio/xata-go/xata"
)
func main () {
workspaceCli , err := xata . NewWorkspacesClient ()
if err != nil {
log . Fatal ( err )
}
resp , err := workspaceCli . List ( context . Background ())
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "%#v n " , * resp . Workspaces [ 0 ])
// Output: api.GetWorkspacesListResponseWorkspacesItem{ID:"Alice-s-workspace-abcd", Name:"Alice's workspace", Slug:"Alice-s-workspace", Role:0x1}
item := * resp . Workspaces [ 0 ]
fmt . Printf ( "%s n " , item . Role . String ())
// Output: owner
}API 키는 클라이언트 생성자의 매개 변수로 제공 될 수도 있습니다.
workspaceCli , err := xata . NewWorkspacesClient ( xata . WithAPIKey ( "my-api-key" ))Xata에 대한 자세한 내용은 Xata.io를 방문하십시오.
make test make integration-testmake lint코드 생성에 대한 페이지와 새 클라이언트를 추가하여 SDK의 아키텍처에 대해 자세히 알아 보는 방법을 참조하십시오.