Skip to content

Commit

Permalink
Merge pull request #51 from xataio/refactor-input-file
Browse files Browse the repository at this point in the history
Upload File TTL
  • Loading branch information
philkra authored Jan 5, 2024
2 parents fce93e3 + 6c047a6 commit 572823c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on: [push]

jobs:
build:
#runs-on: [self-hosted, default]
runs-on: default
runs-on: [self-hosted, default]
steps:
- uses: actions/checkout@v3
- name: Set up Go
Expand Down
11 changes: 7 additions & 4 deletions internal/integration-tests/records_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,16 @@ func generateInsertRecordRequest(databaseName, tableName string) xata.InsertReco
integerColumn: xata.ValueFromInteger(10),
floatColumn: xata.ValueFromDouble(10.3),
fileColumn: xata.ValueFromInputFile(xata.InputFile{
Name: testFileName,
Base64Content: xata.String(base64.StdEncoding.EncodeToString([]byte(fileContent))),
Name: testFileName,
Base64Content: xata.String(base64.StdEncoding.EncodeToString([]byte(fileContent))),
EnablePublicUrl: xata.Bool(true),
}),
fileArrayColumn: xata.ValueFromInputFileArray(xata.InputFileArray{
{
Name: xata.String(testFileName),
Base64Content: xata.String(base64.StdEncoding.EncodeToString([]byte(fileContent))),
Name: xata.String(testFileName),
Base64Content: xata.String(base64.StdEncoding.EncodeToString([]byte(fileContent))),
UploadUrlTimeout: xata.Int(100),
SignedUrlTimeout: xata.Int(600),
},
}),
vectorColumn: xata.ValueFromDoubleList([]float64{10.3, 20.2}),
Expand Down
2 changes: 2 additions & 0 deletions xata/internal/fern-workspace/generated/go/input_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ type InputFile struct {
Name FileName `json:"name"`
// Time to live for signed URLs
SignedUrlTimeout *int `json:"signedUrlTimeout,omitempty"`
// Time to live for upload URLs
UploadUrlTimeout *int `json:"uploadUrlTimeout,omitempty"`
}
2 changes: 2 additions & 0 deletions xata/internal/fern-workspace/generated/go/input_file_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ type InputFileEntry struct {
Name *FileName `json:"name,omitempty"`
// Time to live for signed URLs
SignedUrlTimeout *int `json:"signedUrlTimeout,omitempty"`
// Time to live for upload URLs
UploadUrlTimeout *int `json:"uploadUrlTimeout,omitempty"`
}
14 changes: 14 additions & 0 deletions xata/records_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,20 @@ func ValueFromInputFile(value InputFile) *DataInputRecordValue {

type InputFile xatagenworkspace.InputFile

/*
type InputFile struct {
// Base64 encoded content
Base64Content *string `json:"base64Content,omitempty"`
// Enable public access to the file
EnablePublicUrl *bool `json:"enablePublicUrl,omitempty"`
MediaType *string `json:"mediaType,omitempty"`
Name string `json:"name"`
// Time to live for signed URLs
SignedUrlTimeout *int `json:"signedUrlTimeout,omitempty"`
// Time to live for upload URLs
UploadUrlTimeout *int `json:"uploadUrlTimeout,omitempty"`
}
*/
type recordsClient struct {
generated xatagenworkspace.RecordsClient
dbName string
Expand Down

0 comments on commit 572823c

Please sign in to comment.