diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7fb5821..9ae75b3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.13 + - name: Set up Go 1.15 uses: actions/setup-go@v1 with: - go-version: 1.13 + go-version: 1.15 id: go - name: Check out code into the Go module directory diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 0000000..d971582 --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,44 @@ +package main + +import ( + "fmt" + + "github.com/mehanizm/airtable" +) + +const ( + airtableAPIKey = "xxx" + airtableDBName = "xxx" + airtableTableName = "xxx" +) + +func main() { + airtableClient := airtable.NewClient(airtableAPIKey) + airtableTable := airtableClient.GetTable(airtableDBName, airtableTableName) + + offset := "" + + for { + records, err := airtableTable.GetRecords(). + WithFilterFormula("NOT({SomeBoolColumn})"). + ReturnFields("Column1", "Column2", "Column3", "Column4"). + MaxRecords(100). + PageSize(10). + WithOffset(offset). + Do() + if err != nil { + panic(err) + } + + for recordNum, record := range records.Records { + fmt.Println("====iteration====") + fmt.Println(recordNum, record) + } + + offset = records.Offset + if offset == "" { + break + } + } + +}