diff --git a/Makefile b/Makefile
index 2a968fe..b167546 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,6 @@ help: ## Display help
generate-core-code:
go run xata/internal/core_code_gen.go -scope=core
-.PHONY: generate-core-workspace
-generate-core-workspace:
+.PHONY: generate-workspace-code
+generate-workspace-code:
go run xata/internal/core_code_gen.go -scope=workspace
\ No newline at end of file
diff --git a/xata/internal/core_code_gen.go b/xata/internal/core_code_gen.go
index 0586cae..170871c 100644
--- a/xata/internal/core_code_gen.go
+++ b/xata/internal/core_code_gen.go
@@ -212,6 +212,8 @@ func updateWorkspaceAPISpecs(filePath string) error {
delete(openAPI.Paths, "/db/{db_branch_name}/migrations")
delete(openAPI.Paths, "/db/{db_branch_name}/migrations/execute")
delete(openAPI.Paths, "/db/{db_branch_name}/migrations/plan")
+
+ log.Println("updating file[] as fileArray")
columnEnums := openAPI.Components["schemas"].(map[string]any)["Column"].(map[string]any)["properties"].(map[string]any)["type"].(map[string]any)["enum"].([]any)
var newColumnEnums []string
for _, e := range columnEnums {
@@ -224,6 +226,40 @@ func updateWorkspaceAPISpecs(filePath string) error {
openAPI.Components["schemas"].(map[string]any)["Column"].(map[string]any)["properties"].(map[string]any)["type"].(map[string]any)["enum"] = newColumnEnums
+ for k, v := range openAPI.Components["schemas"].(map[string]any)["Column"].(map[string]any)["properties"].(map[string]any) {
+ if k == "file[]" {
+ openAPI.Components["schemas"].(map[string]any)["Column"].(map[string]any)["properties"].(map[string]any)["fileArray"] = v
+ delete(openAPI.Components["schemas"].(map[string]any)["Column"].(map[string]any)["properties"].(map[string]any), "file[]")
+ }
+
+ }
+
+ // TODO: Add issue link => https://github.com/omerdemirok/xata-go/issues/17
+ log.Println("removing reference of ProjectionConfig from QueryColumnsProjection")
+ var newOneOf []any
+ for _, o := range openAPI.Components["schemas"].(map[string]any)["QueryColumnsProjection"].(map[string]any)["items"].(map[string]any)["oneOf"].([]any) {
+ if o.(map[string]any)["$ref"] != nil && o.(map[string]any)["$ref"] == "#/components/schemas/ProjectionConfig" {
+ continue
+ }
+
+ newOneOf = append(newOneOf, o)
+ }
+ openAPI.Components["schemas"].(map[string]any)["QueryColumnsProjection"].(map[string]any)["items"].(map[string]any)["oneOf"] = newOneOf
+
+ log.Println("remove object value")
+ delete(openAPI.Components["schemas"].(map[string]any), "ObjectValue")
+
+ log.Println("removing reference for object value")
+ var newAnyOf []any
+ for _, o := range openAPI.Components["schemas"].(map[string]any)["DataInputRecord"].(map[string]any)["additionalProperties"].(map[string]any)["anyOf"].([]any) {
+ if o.(map[string]any)["$ref"] != nil && o.(map[string]any)["$ref"] == "#/components/schemas/ObjectValue" {
+ continue
+ }
+
+ newAnyOf = append(newAnyOf, o)
+ }
+ openAPI.Components["schemas"].(map[string]any)["DataInputRecord"].(map[string]any)["additionalProperties"].(map[string]any)["anyOf"] = newAnyOf
+
updatedOpenAPIData, err := json.Marshal(&openAPI)
if err != nil {
fmt.Println("Error marshaling updated OpenAPI data:", err)
diff --git a/xata/internal/fern-workspace/fern/api/generators.yml b/xata/internal/fern-workspace/fern/api/generators.yml
deleted file mode 100644
index d9ce607..0000000
--- a/xata/internal/fern-workspace/fern/api/generators.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-default-group: local
-groups:
- local:
- generators:
- - name: fernapi/fern-go-sdk
- version: 0.0.14
- output:
- location: local-file-system
- path: ../../generated/go
- config:
- importPath: github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go
diff --git a/xata/internal/fern-workspace/fern/api/openapi/workspace-openapi.json b/xata/internal/fern-workspace/fern/api/openapi/workspace-openapi.json
deleted file mode 100644
index 418cb9c..0000000
--- a/xata/internal/fern-workspace/fern/api/openapi/workspace-openapi.json
+++ /dev/null
@@ -1 +0,0 @@
-{"openapi":"3.0.0","info":{"contact":{"name":"support@xata.io"},"description":"Xata.io Xatabases API","license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"},"title":"xata-xb","version":"1.0"},"servers":[{"description":"","url":"/"}],"paths":{"/db/{db_branch_name}":{"delete":{"description":"Delete the branch in the database and all its resources","operationId":"deleteBranch","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"status":{"$ref":"#/components/schemas/MigrationStatus"}},"required":["status"],"type":"object"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"409":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Delete Database branch","tags":["Branch"]},"description":"This path allows interacting with a given database branch, referenced by parameter `db_branch_name`, which is expected in the format `database_name:branch_name`.","get":{"operationId":"getBranchDetails","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DBBranch"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Get branch schema and metadata","tags":["Branch"]},"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"put":{"operationId":"createBranch","parameters":[{"description":"Name of source branch to branch the new schema from","in":"query","name":"from","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"from":{"description":"Select the branch to fork from. Defaults to 'main'","type":"string"},"metadata":{"$ref":"#/components/schemas/BranchMetadata"}},"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"description":"","example":{"branchName":"mybranch","databaseName":"mydatabase","status":"completed"},"properties":{"branchName":{"type":"string"},"databaseName":{"minLength":1,"type":"string"},"status":{"$ref":"#/components/schemas/MigrationStatus"}},"required":["databaseName","branchName","status"],"type":"object"}}},"description":"Created","headers":{"Location":{"description":"URI to newly created resource: /db/{db_branch_name}","schema":{"format":"uri","type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"423":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Create Database branch","tags":["Branch"]},"summary":"Database Branch by Name"},"/db/{db_branch_name}/metadata":{"description":"This path allows interacting with the metadata of a specific database branch.","get":{"operationId":"getBranchMetadata","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchMetadata"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Get Branch Metadata","tags":["Branch"]},"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"put":{"description":"Update the branch metadata","operationId":"updateBranchMetadata","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchMetadata"}}}},"responses":{"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Update branch metadata","tags":["Branch"]},"summary":"Branch Metadata"},"/db/{db_branch_name}/schema/apply":{"description":"Update the branch from schema edit script.","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"post":{"operationId":"applyBranchSchemaEdit","requestBody":{"content":{"application/json":{"schema":{"properties":{"edits":{"$ref":"#/components/schemas/SchemaEditScript"}},"required":["edits"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SchemaUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Apply edit script.","tags":["Migrations"]},"summary":"Update Branch schema with edit script."},"/db/{db_branch_name}/schema/compare":{"description":"Compare the branch schema with a custom provided schema.","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"post":{"operationId":"compareBranchWithUserSchema","requestBody":{"content":{"application/json":{"schema":{"properties":{"branchOperations":{"items":{"$ref":"#/components/schemas/MigrationOp"},"type":"array"},"schema":{"$ref":"#/components/schemas/Schema"},"schemaOperations":{"items":{"$ref":"#/components/schemas/MigrationOp"},"type":"array"}},"required":["schema"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SchemaCompareResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Compare branch with user schema.","tags":["Migrations"]},"summary":"Compare branch with custom schema."},"/db/{db_branch_name}/schema/compare/{branch_name}":{"description":"Compare the schema of any 2 branches.","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/BranchNameParam"}],"post":{"operationId":"compareBranchSchemas","requestBody":{"content":{"application/json":{"schema":{"properties":{"sourceBranchOperations":{"items":{"$ref":"#/components/schemas/MigrationOp"},"type":"array"},"targetBranchOperations":{"items":{"$ref":"#/components/schemas/MigrationOp"},"type":"array"}},"required":["schema"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SchemaCompareResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Compare branch schemas.","tags":["Migrations"]},"summary":"Compare branch schemas."},"/db/{db_branch_name}/schema/history":{"description":"Query the branch its schema history.","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"post":{"operationId":"getBranchSchemaHistory","requestBody":{"content":{"application/json":{"schema":{"properties":{"page":{"properties":{"after":{"description":"Query the next page that follow the cursor.","type":"string"},"before":{"description":"Query the previous page before the cursor.","type":"string"},"size":{"default":20,"description":"Set page size. If the size is missing it is read from the cursor. If no cursor is given xata will choose the default page size.","type":"integer"}},"type":"object"},"since":{"description":"Report only migrations that have been added since the given Migration ID.","type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"logs":{"items":{"$ref":"#/components/schemas/Commit"},"type":"array"},"meta":{"properties":{"cursor":{"description":"last record id","type":"string"},"more":{"description":"true if more records can be fetch","type":"boolean"}},"required":["cursor","more"],"type":"object"}},"required":["meta","logs"],"type":"object"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Query schema history.","tags":["Migrations"]},"summary":"Query schema history."},"/db/{db_branch_name}/schema/preview":{"description":"Preview the resulting branch schema when applying the edit script.","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"post":{"operationId":"previewBranchSchemaEdit","requestBody":{"content":{"application/json":{"schema":{"properties":{"edits":{"$ref":"#/components/schemas/SchemaEditScript"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"original":{"$ref":"#/components/schemas/Schema"},"updated":{"$ref":"#/components/schemas/Schema"}},"required":["original","updated"],"type":"object"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Preview branch schema edits.","tags":["Migrations"]},"summary":"Preview branch schema edits."},"/db/{db_branch_name}/schema/push":{"description":"Apply a list of migrations to the current branch.","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"post":{"description":"The `schema/push` API accepts a list of migrations to be applied to the\ncurrent branch. A list of applicable migrations can be fetched using\nthe `schema/history` API from another branch or database.\n\nThe most recent migration must be part of the list or referenced (via\n`parentID`) by the first migration in the list of migrations to be pushed.\n\nEach migration in the list has an `id`, `parentID`, and `checksum`. The\nchecksum for migrations are generated and verified by xata. The\noperation fails if any migration in the list has an invalid checksum.\n","operationId":"pushBranchMigrations","requestBody":{"content":{"application/json":{"schema":{"properties":{"migrations":{"items":{"$ref":"#/components/schemas/MigrationObject"},"type":"array"}},"required":["migrations"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SchemaUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Push migrations.","tags":["Migrations"]},"summary":"Push migrations."},"/db/{db_branch_name}/schema/update":{"description":"Update the branch schema with migration operations","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"post":{"operationId":"updateBranchSchema","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Migration"}}}},"responses":{"200":{"$ref":"#/components/responses/SchemaUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Update Branch schema","tags":["Migrations"]},"summary":"Update Branch schema"},"/db/{db_branch_name}/search":{"description":"This endpoint performs full text search across an entire database branch. You can filter down to particular\ntable by using the `tables` parameter. The `tables` parameter accepts a mixed array of strings and objects. Using a string (the table name) selects the full table. Using an object allows one to specify a filter as well. The supported filters are the same as documented for the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:\n* filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`\n* filtering on columns of type `multiple` is currently unsupported\n","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"post":{"description":"Run a free text search operation across the database branch.","operationId":"searchBranch","requestBody":{"content":{"application/json":{"schema":{"description":"","example":{"query":"after a long day","tables":["users",{"filter":{"author":"Abigail"},"table":"articles"}]},"properties":{"fuzziness":{"$ref":"#/components/schemas/FuzzinessExpression"},"highlight":{"$ref":"#/components/schemas/HighlightExpression"},"page":{"$ref":"#/components/schemas/SearchPageConfig"},"prefix":{"$ref":"#/components/schemas/PrefixExpression"},"query":{"description":"The query string.","minLength":1,"type":"string"},"tables":{"description":"An array with the tables in which to search. By default, all tables are included. Optionally, filters can be included that apply to each table.","items":{"oneOf":[{"type":"string"},{"additionalProperties":false,"properties":{"boosters":{"items":{"$ref":"#/components/schemas/BoosterExpression"},"type":"array"},"filter":{"$ref":"#/components/schemas/FilterExpression"},"table":{"description":"The name of the table.","type":"string"},"target":{"$ref":"#/components/schemas/TargetExpression"}},"required":["table"],"type":"object"}]},"type":"array"}},"required":["query"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SearchResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"503":{"$ref":"#/components/responses/ServiceUnavailableError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Free text search","tags":["Search and Filter"]},"summary":"Search Database"},"/db/{db_branch_name}/stats":{"description":"This endpoint presents a number of statistics on a given database's branch.","get":{"description":"Get branch usage metrics.","operationId":"getBranchStats","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"interval":{"type":"string"},"numberOfRecords":{"items":{"$ref":"#/components/schemas/MetricsDatapoint"},"type":"array"},"readLatency":{"$ref":"#/components/schemas/MetricsLatency"},"readsOverTime":{"items":{"$ref":"#/components/schemas/MetricsDatapoint"},"type":"array"},"resolution":{"type":"string"},"timestamp":{"type":"string"},"warning":{"type":"string"},"writeLatency":{"$ref":"#/components/schemas/MetricsLatency"},"writesOverTime":{"items":{"$ref":"#/components/schemas/MetricsDatapoint"},"type":"array"}},"required":["timestamp","interval","resolution"],"type":"object"}}},"description":"OK"},"400":{"$ref":"#/components/responses/SimpleError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Branch stats","tags":["Branch"]},"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"summary":"Branch Statistics"},"/db/{db_branch_name}/tables/{table_name}":{"delete":{"description":"Deletes the table with the given name.","operationId":"deleteTable","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"status":{"$ref":"#/components/schemas/MigrationStatus"}},"required":["status"],"type":"object"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"description":"Not Found"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Delete table","tags":["Table"]},"description":"This endpoint provides a way to mutate a specific table on a database.","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"}],"patch":{"description":"Update table. Currently there is only one update operation supported: renaming the table by providing a new name.\n\nIn the example below, we rename a table from “users” to “people”:\n\n```json\n// PATCH /db/test:main/tables/users\n\n{\n \"name\": \"people\"\n}\n```","operationId":"updateTable","requestBody":{"content":{"application/json":{"schema":{"description":"","properties":{"name":{"minLength":1,"type":"string"}},"required":["name"],"type":"object"}}},"description":""},"responses":{"200":{"$ref":"#/components/responses/SchemaUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"422":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Update table","tags":["Table"]},"put":{"description":"Creates a new table with the given name. Returns 422 if a table with the same name already exists.","operationId":"createTable","responses":{"201":{"content":{"application/json":{"schema":{"description":"","example":{"branchName":"mydb_main","status":"completed","tableName":"mytable"},"properties":{"branchName":{"type":"string"},"status":{"$ref":"#/components/schemas/MigrationStatus"},"tableName":{"minLength":1,"type":"string"}},"required":["branchName","tableName","status"],"type":"object"}}},"description":"Created","headers":{"Location":{"description":"URI to newly created resource: /db/{db_branch_name}/tables/{table_name}","schema":{"format":"uri","type":"string"}}}},"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"422":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Create table","tags":["Table"]},"summary":"Database Table by Name"},"/db/{db_branch_name}/tables/{table_name}/aggregate":{"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"}],"post":{"description":"This endpoint allows you to run aggregations (analytics) on the data from one table.\nWhile the summary endpoint is served from a transactional store and the results are strongly \nconsistent, the aggregate endpoint is served from our columnar store and the results are \nonly eventually consistent. On the other hand, the aggregate endpoint uses a \nstore that is more appropiate for analytics, makes use of approximative algorithms \n(e.g for cardinality), and is generally faster and can do more complex aggregations.\n\nFor usage, see the [API Guide](https://xata.io/docs/api-guide/aggregate).\n","operationId":"aggregateTable","requestBody":{"content":{"application/json":{"schema":{"properties":{"aggs":{"$ref":"#/components/schemas/AggExpressionMap"},"filter":{"$ref":"#/components/schemas/FilterExpression"}},"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/AggResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Run aggregations over a table","tags":["Search and Filter"]},"summary":"Aggregate Table"},"/db/{db_branch_name}/tables/{table_name}/ask":{"description":"Ask your table a question and have Xata answer.","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"}],"post":{"description":"Ask your table a question. If the `Accept` header is set to `text/event-stream`, Xata will stream the results back as SSE's.","operationId":"askTable","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"","properties":{"question":{"description":"The question you'd like to ask.","minLength":3,"type":"string"},"rules":{"items":{"type":"string"},"type":"array"},"search":{"additionalProperties":false,"properties":{"boosters":{"items":{"$ref":"#/components/schemas/BoosterExpression"},"type":"array"},"filter":{"$ref":"#/components/schemas/FilterExpression"},"fuzziness":{"$ref":"#/components/schemas/FuzzinessExpression"},"prefix":{"$ref":"#/components/schemas/PrefixExpression"},"target":{"$ref":"#/components/schemas/TargetExpression"}},"type":"object"},"searchType":{"default":"keyword","description":"The type of search to use. If set to `keyword` (the default), the search can be configured by passing\na `search` object with the following fields. For more details about each, see the Search endpoint documentation.\nAll fields are optional.\n * fuzziness - typo tolerance\n * target - columns to search into, and weights.\n * prefix - prefix search type.\n * filter - pre-filter before searching.\n * boosters - control relevancy.\nIf set to `vector`, a `vectorSearch` object must be passed, with the following parameters. For more details, see the Vector\nSearch endpoint documentation. The `column` and `contentColumn` parameters are required.\n * column - the vector column containing the embeddings.\n * contentColumn - the column that contains the text from which the embeddings where computed.\n * filter - pre-filter before searching.\n","enum":["keyword","vector"],"type":"string"},"vectorSearch":{"additionalProperties":false,"properties":{"column":{"description":"The column to use for vector search. It must be of type `vector`.","type":"string"},"contentColumn":{"description":"The column containing the text for vector search. Must be of type `text`.","type":"string"},"filter":{"$ref":"#/components/schemas/FilterExpression"}},"required":["column","contentColumn"],"type":"object"}},"required":["question"],"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"answer":{"description":"The answer to the input question","type":"string"},"sessionId":{"description":"The session ID for the chat session.","type":"string"}},"required":["answer","sessionId"],"type":"object"}},"text/event-stream":{"schema":{"properties":{"answer":{"description":"The answer to the input question","type":"string"},"records":{"description":"The IDs of the records that were used as context.","items":{"type":"string"},"type":"array"},"sessionId":{"description":"The session ID for the chat session.","type":"string"}},"required":["answer","records","sessionId"],"type":"object"}}},"description":"Response to the question"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"429":{"$ref":"#/components/responses/RateLimitError"},"503":{"description":"Unexpected Error"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Ask your table a question","tags":["Search and Filter"]},"summary":"Ask data in your table a question"},"/db/{db_branch_name}/tables/{table_name}/ask/{session_id}":{"description":"Continue a conversation with your data. This endpoint lets you continue a question started via the /ask endpoint in order to dive deeper into your context or ask clarifying questions.","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"},{"$ref":"#/components/parameters/ChatSessionIDParam"}],"post":{"description":"Ask a follow-up question. If the `Accept` header is set to `text/event-stream`, Xata will stream the results back as SSE's.","operationId":"askTableSession","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"message":{"description":"The question you'd like to ask.","minLength":3,"type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"answer":{"description":"The answer to the input question","type":"string"}},"required":["answer"],"type":"object"}},"text/event-stream":{"schema":{"properties":{"answer":{"description":"The answer to the input question","type":"string"}},"required":["answer"],"type":"object"}}},"description":"Response to the question"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"429":{"$ref":"#/components/responses/RateLimitError"},"503":{"$ref":"#/components/responses/ServiceUnavailableError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Continue a conversation with your data","tags":["Search and Filter"]},"summary":"Ask follow-up questions of your data"},"/db/{db_branch_name}/tables/{table_name}/bulk":{"description":"This endpoint enables bulk operations on a given table. For now, we only allow bulk inserting.\n\nAn example bulk request looks like this:\n\n```json\n// POST https://tutorial-ng7s8c.xata.sh/db/tutorial:main/tables/users/bulk\n\n{\n \"records\": [\n {\n \"email\": \"laurence@example.com\",\n \"full_name\": \"Laurence Fishburne\",\n \"team\": \"rec_c8hng2h26un90p8sr7k0\"\n },\n {\n \"email\": \"hugo@example.com\",\n \"full_name\": \"Hugo Weaving\",\n \"team\": \"rec_c8hng2h26un90p8sr7k0\"\n },\n {\n \"email\": \"joe@example.com\",\n \"full_name\": \"Joe Pantoliano\",\n \"team\": \"rec_c8hng2h26un90p8sr7k0\"\n }\n ]\n}\n```\nFor more details, see the [this section](/web-api/records/insert#inserting-records-in-bulk) from the tutorial.\n","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"},{"$ref":"#/components/parameters/ColumnsProjectionParam"}],"post":{"description":"Bulk insert records","operationId":"bulkInsertTableRecords","requestBody":{"content":{"application/json":{"schema":{"properties":{"records":{"items":{"$ref":"#/components/schemas/DataInputRecord"},"type":"array"}},"required":["records"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/BulkInsertResponse"},"400":{"$ref":"#/components/responses/BulkError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"422":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Bulk insert records","tags":["Records"],"x-experimental":true},"summary":"Bulk Table Operations"},"/db/{db_branch_name}/tables/{table_name}/columns":{"description":"This endpoint allows working with a table's columns.","get":{"description":"Retrieves the list of table columns and their definition. This endpoint returns the column list with object columns being reported with their\nfull dot-separated path (flattened).\n","operationId":"getTableColumns","responses":{"200":{"content":{"application/json":{"schema":{"example":{"columns":[{"name":"name","type":"string"},{"name":"email","type":"email"},{"name":"settings.plan","type":"string"},{"name":"settings.dark","type":"bool"}]},"properties":{"columns":{"items":{"$ref":"#/components/schemas/Column"},"type":"array"}},"required":["columns"],"type":"object"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"List table columns","tags":["Table"]},"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"}],"post":{"description":"Adds a new column to the table. The body of the request should contain the column definition.","operationId":"addTableColumn","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Column","example":{"name":"columnName","type":"string"}}}},"description":"The column definition."},"responses":{"200":{"$ref":"#/components/responses/SchemaUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Create new column","tags":["Table"]},"summary":"Table Columns"},"/db/{db_branch_name}/tables/{table_name}/columns/{column_name}":{"delete":{"description":"Deletes the specified column.","operationId":"deleteColumn","responses":{"200":{"$ref":"#/components/responses/SchemaUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Delete column","tags":["Table"]},"description":"This endpoint allows working with a single column from a given table.","get":{"description":"Get the definition of a single column.","operationId":"getColumn","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Column","example":{"value":{"name":"settings.labels","type":"multiple"}}}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Get column information","tags":["Table"]},"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"},{"$ref":"#/components/parameters/ColumnNameParam"}],"patch":{"description":"Update column with partial data. Can be used for renaming the column by providing a new \"name\" field.","operationId":"updateColumn","requestBody":{"content":{"application/json":{"examples":{"Rename column":{"value":{"name":"new_name"}}},"schema":{"description":"","example":{"description":"Sample new description","name":"newName"},"properties":{"name":{"minLength":1,"type":"string"}},"required":["name"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SchemaUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Update column","tags":["Table"]},"summary":"Single Table Column"},"/db/{db_branch_name}/tables/{table_name}/data":{"description":"This endpoint enables mutating data into a given database table. To query data, please see the [query endpoint](query).\nFor a tutorial on using the Records API, see the [Record API documentation](/rest-api/intro).\n","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"},{"$ref":"#/components/parameters/ColumnsProjectionParam"}],"post":{"description":"Insert a new Record into the Table","operationId":"insertRecord","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataInputRecord"}}}},"responses":{"201":{"$ref":"#/components/responses/RecordUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Insert record","tags":["Records"]},"summary":"Table Data"},"/db/{db_branch_name}/tables/{table_name}/data/{record_id}":{"delete":{"operationId":"deleteRecord","responses":{"200":{"$ref":"#/components/responses/RecordResponse"},"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Delete record from table","tags":["Records"]},"description":"This endpoint enables mutating a given record in a table, referenced by its ID.","get":{"description":"Retrieve record by ID","operationId":"getRecord","responses":{"200":{"$ref":"#/components/responses/RecordResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Get record by ID","tags":["Records"]},"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"},{"$ref":"#/components/parameters/RecordIDParam"},{"$ref":"#/components/parameters/ColumnsProjectionParam"}],"patch":{"operationId":"updateRecordWithID","parameters":[{"in":"query","name":"ifVersion","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataInputRecord"}}}},"responses":{"200":{"$ref":"#/components/responses/RecordUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"422":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Update record with ID","tags":["Records"]},"post":{"operationId":"upsertRecordWithID","parameters":[{"in":"query","name":"ifVersion","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataInputRecord"}}}},"responses":{"200":{"$ref":"#/components/responses/RecordUpdateResponse"},"201":{"$ref":"#/components/responses/RecordUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"422":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Upsert record with ID","tags":["Records"]},"put":{"description":"By default, IDs are auto-generated when data is insterted into Xata. Sending a request to this endpoint allows us to insert a record with a pre-existing ID, bypassing the default automatic ID generation.","operationId":"insertRecordWithID","parameters":[{"in":"query","name":"createOnly","schema":{"type":"boolean"}},{"in":"query","name":"ifVersion","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataInputRecord"}}}},"responses":{"200":{"$ref":"#/components/responses/RecordUpdateResponse"},"201":{"$ref":"#/components/responses/RecordUpdateResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"422":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Insert record with ID","tags":["Records"]},"summary":"Table Record"},"/db/{db_branch_name}/tables/{table_name}/data/{record_id}/column/{column_name}/file":{"delete":{"description":"Deletes a file referred in a file column","operationId":"deleteFile","responses":{"200":{"$ref":"#/components/responses/PutFileResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Remove the content from a file column","tags":["Files"]},"description":"File access endpoint allows upload and download of binary file content.","get":{"description":"Retrieves the file content from a file column","operationId":"getFile","responses":{"200":{"content":{"*/*":{"schema":{"format":"binary","type":"string"}}},"description":"OK"},"204":{"description":"no content"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Download content from a file column","tags":["Files"]},"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"},{"$ref":"#/components/parameters/RecordIDParam"},{"$ref":"#/components/parameters/ColumnNameParam"}],"put":{"description":"Uploads the file content to the given file column","operationId":"putFile","requestBody":{"content":{"*/*":{"schema":{"format":"binary","type":"string"}}}},"responses":{"200":{"$ref":"#/components/responses/PutFileResponse"},"201":{"$ref":"#/components/responses/PutFileResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"422":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Upload content to a file column","tags":["Files"]},"summary":"File column access"},"/db/{db_branch_name}/tables/{table_name}/data/{record_id}/column/{column_name}/file/{file_id}":{"delete":{"description":"Deletes an item from an file array column given the file ID","operationId":"deleteFileItem","responses":{"200":{"$ref":"#/components/responses/PutFileResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Delete an item from a file array","tags":["Files"]},"description":"File array access endpoint allows upload, download and remove of file items.","get":{"description":"Retrieves file content from an array by file ID","operationId":"getFileItem","responses":{"200":{"content":{"*/*":{"schema":{"format":"binary","type":"string"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Download content from a file item in a file array column","tags":["Files"]},"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"},{"$ref":"#/components/parameters/RecordIDParam"},{"$ref":"#/components/parameters/ColumnNameParam"},{"$ref":"#/components/parameters/FileItemIDParam"}],"put":{"description":"Uploads the file content to an array given the file ID","operationId":"putFileItem","requestBody":{"content":{"*/*":{"schema":{"format":"binary","type":"string"}}}},"responses":{"200":{"$ref":"#/components/responses/PutFileResponse"},"201":{"$ref":"#/components/responses/PutFileResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"422":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Upload or update the content of a file item in a file array column","tags":["Files"]},"summary":"File array access"},"/db/{db_branch_name}/tables/{table_name}/query":{"description":"This endpoint serves data from a given table, inside a specific database's branch.\nFor a tutorial on using the Records API, see the [Record API documentation](/rest-api/intro).\n","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"}],"post":{"description":"The Query Table API can be used to retrieve all records in a table.\nThe API support filtering, sorting, selecting a subset of columns, and pagination.\n\nThe overall structure of the request looks like this:\n\n```json\n// POST /db/\u003cdbname\u003e:\u003cbranch\u003e/tables/\u003ctable\u003e/query\n{\n \"columns\": [...],\n \"filter\": {\n \"$all\": [...],\n \"$any\": [...]\n ...\n },\n \"sort\": {\n \"multiple\": [...]\n ...\n },\n \"page\": {\n ...\n }\n}\n```\n\nFor usage, see also the [API Guide](https://xata.io/docs/api-guide/get).\n\n### Column selection\n\nIf the `columns` array is not specified, all columns are included. For link\nfields, only the ID column of the linked records is included in the response.\n\nIf the `columns` array is specified, only the selected and internal\ncolumns `id` and `xata` are included. The `*` wildcard can be used to\nselect all columns.\n\nFor objects and link fields, if the column name of the object is specified, we\ninclude all of its sub-keys. If only some sub-keys are specified (via dotted\nnotation, e.g. `\"settings.plan\"` ), then only those sub-keys from the object\nare included.\n\nBy the way of example, assuming two tables like this:\n\n```json {\"truncate\": true}\n{\n \"tables\": [\n {\n \"name\": \"teams\",\n \"columns\": [\n {\n \"name\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"owner\",\n \"type\": \"link\",\n \"link\": {\n \"table\": \"users\"\n }\n },\n {\n \"name\": \"foundedDate\",\n \"type\": \"datetime\"\n },\n ]\n },\n {\n \"name\": \"users\",\n \"columns\": [\n {\n \"name\": \"email\",\n \"type\": \"email\"\n },\n {\n \"name\": \"full_name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"address\",\n \"type\": \"object\",\n \"columns\": [\n {\n \"name\": \"street\",\n \"type\": \"string\"\n },\n {\n \"name\": \"number\",\n \"type\": \"int\"\n },\n {\n \"name\": \"zipcode\",\n \"type\": \"int\"\n }\n ]\n },\n {\n \"name\": \"team\",\n \"type\": \"link\",\n \"link\": {\n \"table\": \"teams\"\n }\n }\n ]\n }\n ]\n}\n```\n\nA query like this:\n\n```json\nPOST /db/\u003cdbname\u003e:\u003cbranch\u003e/tables/\u003ctable\u003e/query\n{\n \"columns\": [\n \"name\",\n \"address.*\"\n ]\n}\n```\n\nreturns objects like:\n\n```json\n{\n \"name\": \"Kilian\",\n \"address\": {\n \"street\": \"New street\",\n \"number\": 41,\n \"zipcode\": 10407\n }\n}\n```\n\nwhile a query like this:\n\n```json\nPOST /db/\u003cdbname\u003e:\u003cbranch\u003e/tables/\u003ctable\u003e/query\n{\n \"columns\": [\n \"name\",\n \"address.street\"\n ]\n}\n```\n\nreturns objects like:\n\n```json\n{\n \"id\": \"id1\"\n \"xata\": {\n \"version\": 0\n }\n \"name\": \"Kilian\",\n \"address\": {\n \"street\": \"New street\"\n }\n}\n```\n\nIf you want to return all columns from the main table and selected columns from the linked table, you can do it like this:\n\n```json\n{\n \"columns\": [\"*\", \"team.name\"]\n}\n```\n\nThe `\"*\"` in the above means all columns, including columns of objects. This returns data like:\n\n```json\n{\n \"id\": \"id1\"\n \"xata\": {\n \"version\": 0\n }\n \"name\": \"Kilian\",\n \"email\": \"kilian@gmail.com\",\n \"address\": {\n \"street\": \"New street\",\n \"number\": 41,\n \"zipcode\": 10407\n },\n \"team\": {\n \"id\": \"XX\",\n \"xata\": {\n \"version\": 0\n },\n \"name\": \"first team\"\n }\n}\n```\n\nIf you want all columns of the linked table, you can do:\n\n```json\n{\n \"columns\": [\"*\", \"team.*\"]\n}\n```\n\nThis returns, for example:\n\n```json\n{\n \"id\": \"id1\"\n \"xata\": {\n \"version\": 0\n }\n \"name\": \"Kilian\",\n \"email\": \"kilian@gmail.com\",\n \"address\": {\n \"street\": \"New street\",\n \"number\": 41,\n \"zipcode\": 10407\n },\n \"team\": {\n \"id\": \"XX\",\n \"xata\": {\n \"version\": 0\n },\n \"name\": \"first team\",\n \"code\": \"A1\",\n \"foundedDate\": \"2020-03-04T10:43:54.32Z\"\n }\n}\n```\n\n### Filtering\n\nThere are two types of operators:\n\n- Operators that work on a single column: `$is`, `$contains`, `$pattern`,\n `$includes`, `$gt`, etc.\n- Control operators that combine multiple conditions: `$any`, `$all`, `$not` ,\n `$none`, etc.\n\nAll operators start with an `$` to differentiate them from column names\n(which are not allowed to start with a dollar sign).\n\n#### Exact matching and control operators\n\nFilter by one column:\n\n```json\n{\n \"filter\": {\n \"\u003ccolumn_name\u003e\": \"value\"\n }\n}\n```\n\nThis is equivalent to using the `$is` operator:\n\n```json\n{\n \"filter\": {\n \"\u003ccolumn_name\u003e\": {\n \"$is\": \"value\"\n }\n }\n}\n```\n\nFor example:\n\n```json\n{\n \"filter\": {\n \"name\": \"r2\"\n }\n}\n```\n\nOr:\n\n```json\n{\n \"filter\": {\n \"name\": {\n \"$is\": \"r2\"\n }\n }\n}\n```\n\nFor objects, both dots and nested versions work:\n\n```json\n{\n \"filter\": {\n \"settings.plan\": \"free\"\n }\n}\n```\n\n```json\n{\n \"filter\": {\n \"settings\": {\n \"plan\": \"free\"\n }\n }\n}\n```\n\nIf you want to OR together multiple values, you can use the `$any` operator with an array of values:\n\n```json\n{\n \"filter\": {\n \"settings.plan\": { \"$any\": [\"free\", \"paid\"] }\n }\n}\n```\n\nIf you specify multiple columns in the same filter, they are logically AND'ed together:\n\n```json\n{\n \"filter\": {\n \"settings.dark\": true,\n \"settings.plan\": \"free\"\n }\n}\n```\n\nThe above matches if both conditions are met.\n\nTo be more explicit about it, you can use `$all` or `$any`:\n\n```json\n{\n \"filter\": {\n \"$any\": {\n \"settings.dark\": true,\n \"settings.plan\": \"free\"\n }\n }\n}\n```\n\nThe `$all` and `$any` operators can also receive an array of objects, which allows for repeating column names:\n\n```json\n{\n \"filter\": {\n \"$any\": [\n {\n \"name\": \"r1\"\n },\n {\n \"name\": \"r2\"\n }\n ]\n }\n}\n```\n\nYou can check for a value being not-null with `$exists`:\n\n```json\n{\n \"filter\": {\n \"$exists\": \"settings\"\n }\n}\n```\n\nThis can be combined with `$all` or `$any` :\n\n```json\n{\n \"filter\": {\n \"$all\": [\n {\n \"$exists\": \"settings\"\n },\n {\n \"$exists\": \"name\"\n }\n ]\n }\n}\n```\n\nOr you can use the inverse operator `$notExists`:\n\n```json\n{\n \"filter\": {\n \"$notExists\": \"settings\"\n }\n}\n```\n\n#### Partial match\n\n`$contains` is the simplest operator for partial matching. Note that `$contains` operator can\ncause performance issues at scale, because indices cannot be used.\n\n```json\n{\n \"filter\": {\n \"\u003ccolumn_name\u003e\": {\n \"$contains\": \"value\"\n }\n }\n}\n```\n\nWildcards are supported via the `$pattern` operator:\n\n```json\n{\n \"filter\": {\n \"\u003ccolumn_name\u003e\": {\n \"$pattern\": \"v*alu?\"\n }\n }\n}\n```\n\nThe `$pattern` operator accepts two wildcard characters:\n* `*` matches zero or more characters\n* `?` matches exactly one character\n\nIf you want to match a string that contains a wildcard character, you can escape them using a backslash (`\\`). You can escape a backslash by usign another backslash.\n\nYou can also use the `$endsWith` and `$startsWith` operators:\n\n```json\n{\n \"filter\": {\n \"\u003ccolumn_name\u003e\": {\n \"$endsWith\": \".gz\"\n },\n \"\u003ccolumn_name\u003e\": {\n \"$startsWith\": \"tmp-\"\n }\n }\n}\n```\n\n#### Numeric or datetime ranges\n\n```json\n{\n \"filter\": {\n \"\u003ccolumn_name\u003e\": {\n \"$ge\": 0,\n \"$lt\": 100\n }\n }\n}\n```\nDate ranges support the same operators, with the date using the format defined in\n[RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):\n```json\n{\n \"filter\": {\n \"\u003ccolumn_name\u003e\": {\n \"$gt\": \"2019-10-12T07:20:50.52Z\",\n \"$lt\": \"2021-10-12T07:20:50.52Z\"\n }\n }\n}\n```\nThe supported operators are `$gt`, `$lt`, `$ge`, `$le`.\n\n#### Negations\n\nA general `$not` operator can inverse any operation.\n\n```json\n{\n \"filter\": {\n \"$not\": {\n \"\u003ccolumn_name1\u003e\": \"value1\",\n \"\u003ccolumn_name2\u003e\": \"value1\"\n }\n }\n}\n```\n\nNote: in the above the two condition are AND together, so this does (NOT ( ...\nAND ...))\n\nOr more complex:\n\n```json\n{\n \"filter\": {\n \"$not\": {\n \"$any\": [\n {\n \"\u003ccolumn_name1\u003e\": \"value1\"\n },\n {\n \"$all\": [\n {\n \"\u003ccolumn_name2\u003e\": \"value2\"\n },\n {\n \"\u003ccolumn_name3\u003e\": \"value3\"\n }\n ]\n }\n ]\n }\n }\n}\n```\n\nThe `$not: { $any: {}}` can be shorted using the `$none` operator:\n\n```json\n{\n \"filter\": {\n \"$none\": {\n \"\u003ccolumn_name1\u003e\": \"value1\",\n \"\u003ccolumn_name2\u003e\": \"value1\"\n }\n }\n}\n```\n\nIn addition, you can use operators like `$isNot` or `$notExists` to simplify expressions:\n\n```json\n{\n \"filter\": {\n \"\u003ccolumn_name\u003e\": {\n \"$isNot\": \"2019-10-12T07:20:50.52Z\"\n }\n }\n}\n```\n\n#### Working with arrays\n\nTo test that an array contains a value, use `$includesAny`.\n\n```json\n{\n \"filter\": {\n \"\u003carray_name\u003e\": {\n \"$includesAny\": \"value\"\n }\n }\n}\n```\n\n##### `includesAny`\n\nThe `$includesAny` operator accepts a custom predicate that will check if\nany value in the array column matches the predicate. The `$includes` operator is a\nsynonym for the `$includesAny` operator.\n\nFor example a complex predicate can include\nthe `$all` , `$contains` and `$endsWith` operators:\n\n```json\n{\n \"filter\": {\n \"\u003carray name\u003e\": {\n \"$includes\": {\n \"$all\": [\n { \"$contains\": \"label\" },\n { \"$not\": { \"$endsWith\": \"-debug\" } }\n ]\n }\n }\n }\n}\n```\n\n##### `includesNone`\n\nThe `$includesNone` operator succeeds if no array item matches the\npredicate.\n\n```json\n{\n \"filter\": {\n \"settings.labels\": {\n \"$includesNone\": [{ \"$contains\": \"label\" }]\n }\n }\n}\n```\nThe above matches if none of the array values contain the string \"label\".\n\n##### `includesAll`\n\nThe `$includesAll` operator succeeds if all array items match the\npredicate.\n\nHere is an example of using the `$includesAll` operator:\n\n```json\n{\n \"filter\": {\n \"settings.labels\": {\n \"$includesAll\": [{ \"$contains\": \"label\" }]\n }\n }\n}\n```\n\nThe above matches if all array values contain the string \"label\".\n\n### Sorting\n\nSorting by one element:\n\n```json\nPOST /db/demo:main/tables/table/query\n{\n \"sort\": {\n \"index\": \"asc\"\n }\n}\n```\n\nor descendently:\n\n```json\nPOST /db/demo:main/tables/table/query\n{\n \"sort\": {\n \"index\": \"desc\"\n }\n}\n```\n\nSorting by multiple fields:\n\n```json\nPOST /db/demo:main/tables/table/query\n{\n \"sort\": [\n {\n \"index\": \"desc\"\n },\n {\n \"createdAt\": \"desc\"\n }\n ]\n}\n```\n\nIt is also possible to sort results randomly:\n\n```json\nPOST /db/demo:main/tables/table/query\n{\n \"sort\": {\n \"*\": \"random\"\n }\n}\n```\n\nNote that a random sort does not apply to a specific column, hence the special column name `\"*\"`.\n\nA random sort can be combined with an ascending or descending sort on a specific column:\n\n```json\nPOST /db/demo:main/tables/table/query\n{\n \"sort\": [\n {\n \"name\": \"desc\"\n },\n {\n \"*\": \"random\"\n }\n ]\n}\n```\n\nThis will sort on the `name` column, breaking ties randomly.\n\n### Pagination\n\nWe offer cursor pagination and offset pagination. The cursor pagination method can be used for sequential scrolling with unrestricted depth. The offset pagination can be used to skip pages and is limited to 1000 records.\n\nExample of cursor pagination:\n\n```json\nPOST /db/demo:main/tables/table/query\n{\n \"page\": {\n \"after\":\"fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD\"\n }\n}\n```\n\nIn the above example, the value of the `page.after` parameter is the cursor returned by the previous query. A sample response is shown below:\n\n```json\n{\n \"meta\": {\n \"page\": {\n \"cursor\": \"fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD\",\n \"more\": true\n }\n },\n \"records\": [...]\n}\n```\n\nThe `page` object might contain the follow keys, in addition to `size` and `offset` that were introduced before:\n\n- `after`: Return the next page 'after' the current cursor\n- `before`: Return the previous page 'before' the current cursor.\n- `start`: Resets the given cursor position to the beginning of the query result set. \nWill return the first N records from the query result, where N is the `page.size` parameter. \n- `end`: Resets the give cursor position to the end for the query result set. \nReturns the last N records from the query result, where N is the `page.size` parameter.\n\nThe request will fail if an invalid cursor value is given to `page.before`,\n`page.after`, `page.start` , or `page.end`. No other cursor setting can be\nused if `page.start` or `page.end` is set in a query.\n\nIf both `page.before` and `page.after` parameters are present we treat the\nrequest as a range query. The range query will return all entries after\n`page.after`, but before `page.before`, up to `page.size` or the maximum\npage size. This query requires both cursors to use the same filters and sort\nsettings, plus we require `page.after \u003c page.before`. The range query returns\na new cursor. If the range encompass multiple pages the next page in the range\ncan be queried by update `page.after` to the returned cursor while keeping the\n`page.before` cursor from the first range query.\n\nThe `filter` , `columns`, `sort` , and `page.size` configuration will be\nencoded with the cursor. The pagination request will be invalid if\n`filter` or `sort` is set. The columns returned and page size can be changed\nanytime by passing the `columns` or `page.size` settings to the next query.\n\nIn the following example of size + offset pagination we retrieve the third page of up to 100 results:\n\n```json\nPOST /db/demo:main/tables/table/query\n{\n \"page\": {\n \"size\": 100,\n \"offset\": 200\n }\n}\n```\n\nThe `page.size` parameter represents the maximum number of records returned by this query. It has a default value of 20 and a maximum value of 200.\nThe `page.offset` parameter represents the number of matching records to skip. It has a default value of 0 and a maximum value of 800.\n\nCursor pagination also works in combination with offset pagination. For example, starting from a specific cursor position, using a page size of 200 and an offset of 800, you can skip up to 5 pages of 200 records forwards or backwards from the cursor's position:\n\n```json\nPOST /db/demo:main/tables/table/query\n{\n \"page\": {\n \"size\": 200,\n \"offset\": 800,\n \"after\": \"fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD\"\n }\n}\n```\n\n**Special cursors:**\n\n- `page.after=end`: Result points past the last entry. The list of records\n returned is empty, but `page.meta.cursor` will include a cursor that can be\n used to \"tail\" the table from the end waiting for new data to be inserted.\n- `page.before=end`: This cursor returns the last page.\n- `page.start=$cursor`: Start at the beginning of the result set of the $cursor query. This is equivalent to querying the\n first page without a cursor but applying `filter` and `sort` . Yet the `page.start`\n cursor can be convenient at times as user code does not need to remember the\n filter, sort, columns or page size configuration. All these information are\n read from the cursor.\n- `page.end=$cursor`: Move to the end of the result set of the $cursor query. This is equivalent to querying the\n last page with `page.before=end`, `filter`, and `sort` . Yet the\n `page.end` cursor can be more convenient at times as user code does not\n need to remember the filter, sort, columns or page size configuration. All\n these information are read from the cursor.\n\nWhen using special cursors like `page.after=\"end\"` or `page.before=\"end\"`, we\nstill allow `filter` and `sort` to be set.\n\nExample of getting the last page:\n\n```json\nPOST /db/demo:main/tables/table/query\n{\n \"page\": {\n \"size\": 10,\n \"before\": \"end\"\n }\n}\n```\n","operationId":"queryTable","requestBody":{"content":{"application/json":{"schema":{"properties":{"columns":{"$ref":"#/components/schemas/QueryColumnsProjection"},"consistency":{"default":"strong","description":"The consistency level for this request.","enum":["strong","eventual"],"type":"string"},"filter":{"$ref":"#/components/schemas/FilterExpression"},"page":{"$ref":"#/components/schemas/PageConfig"},"sort":{"$ref":"#/components/schemas/SortExpression"}},"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/QueryResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"503":{"$ref":"#/components/responses/ServiceUnavailableError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Query table","tags":["Search and Filter"]},"summary":"Query Table Data"},"/db/{db_branch_name}/tables/{table_name}/schema":{"description":"This endpoint enables reading or updating the schema of a given table.","get":{"operationId":"getTableSchema","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"columns":{"items":{"$ref":"#/components/schemas/Column"},"type":"array"}},"required":["columns"],"type":"object"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Get table schema","tags":["Table"]},"parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"}],"put":{"operationId":"setTableSchema","requestBody":{"content":{"application/json":{"schema":{"properties":{"columns":{"items":{"$ref":"#/components/schemas/Column"},"type":"array"}},"required":["columns"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SchemaUpdateResponse"},"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"409":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Update table schema","tags":["Table"]},"summary":"Table Schema"},"/db/{db_branch_name}/tables/{table_name}/search":{"description":"This endpoint performs full text search in a particular table.\n","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"}],"post":{"description":"Run a free text search operation in a particular table.\n\nThe endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:\n* filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`\n* filtering on columns of type `multiple` is currently unsupported\n","operationId":"searchTable","requestBody":{"content":{"application/json":{"schema":{"description":"","example":{"filter":{"firstName":"Abigail"},"query":"after a long day"},"properties":{"boosters":{"items":{"$ref":"#/components/schemas/BoosterExpression"},"type":"array"},"filter":{"$ref":"#/components/schemas/FilterExpression"},"fuzziness":{"$ref":"#/components/schemas/FuzzinessExpression"},"highlight":{"$ref":"#/components/schemas/HighlightExpression"},"page":{"$ref":"#/components/schemas/SearchPageConfig"},"prefix":{"$ref":"#/components/schemas/PrefixExpression"},"query":{"description":"The query string.","minLength":1,"type":"string"},"target":{"$ref":"#/components/schemas/TargetExpression"}},"required":["query"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SearchResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Free text search in a table","tags":["Search and Filter"]},"summary":"Search Table"},"/db/{db_branch_name}/tables/{table_name}/summarize":{"description":"This endpoint summarizes from your database. It comes with a range\nof functions to help perform calculations on the data you have stored\nin your tables\n","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"}],"post":{"description":"This endpoint allows you to (optionally) define groups, and then to run\ncalculations on the values in each group. This is most helpful when \nyou'd like to understand the data you have in your database.\n\nA group is a combination of unique values. If you create a group for \n`sold_by`, `product_name`, we will return one row for every combination \nof `sold_by` and `product_name` you have in your database. When you \nwant to calculate statistics, you define these groups and ask Xata to \ncalculate data on each group.\n\n**Some questions you can ask of your data:**\n\nHow many records do I have in this table?\n- Set `columns: []` as we we want data from the entire table, so we ask\nfor no groups.\n- Set `summaries: {\"total\": {\"count\": \"*\"}}` in order to see the count \nof all records. We use `count: *` here we'd like to know the total \namount of rows; ignoring whether they are `null` or not.\n\nWhat are the top total sales for each product in July 2022 and sold \nmore than 10 units?\n- Set `filter: {soldAt: {\n \"$ge\": \"2022-07-01T00:00:00.000Z\", \n \"$lt\": \"2022-08-01T00:00:00.000Z\"}\n}` \nin order to limit the result set to sales recorded in July 2022.\n- Set `columns: [product_name]` as we'd like to run calculations on \neach unique product name in our table. Setting `columns` like this will \nproduce one row per unique product name.\n- Set `summaries: {\"total_sales\": {\"count\": \"product_name\"}}` as we'd \nlike to create a field called \"total_sales\" for each group. This field \nwill count all rows in each group with non-null product names.\n- Set `sort: [{\"total_sales\": \"desc\"}]` in order to bring the rows with \nthe highest total_sales field to the top.\n- Set `summariesFilter: {\"total_sales\": {\"$ge\": 10}}` to only send back data \nwith greater than or equal to 10 units.\n\n`columns`: tells Xata how to create each group. If you add `product_id` \nwe will create a new group for every unique `product_id`.\n\n`summaries`: tells Xata which calculations to run on each group. Xata\ncurrently supports count, min, max, sum, average.\n\n`sort`: tells Xata in which order you'd like to see results. You may \nsort by fields specified in `columns` as well as the summary names \ndefined in `summaries`.\n\nnote: Sorting on summarized values can be slower on very large tables; \nthis will impact your rate limit significantly more than other queries. \nTry use `filter` to reduce the amount of data being processed in order \nto reduce impact on your limits.\n\n`summariesFilter`: tells Xata how to filter the results of a summary. \nIt has the same syntax as `filter`, however, by using `summariesFilter`\nyou may also filter on the results of a query.\n\nnote: This is a much slower to use than `filter`. We recommend using \n`filter` wherever possible and `summariesFilter` when it's not \npossible to use `filter`.\n\n`page.size`: tells Xata how many records to return. If unspecified, Xata\nwill return the default size.\n","operationId":"summarizeTable","requestBody":{"content":{"application/json":{"schema":{"properties":{"columns":{"$ref":"#/components/schemas/ColumnsProjection"},"consistency":{"default":"strong","description":"The consistency level for this request.","enum":["strong","eventual"],"type":"string"},"filter":{"$ref":"#/components/schemas/FilterExpression"},"page":{"properties":{"size":{"default":20,"description":"The number of records returned by summarize. If the amount of data you have exceeds this, or you have\nmore complex reporting requirements, we recommend that you use the aggregate endpoint instead.\n","maximum":1000,"minimum":1,"type":"integer"}},"type":"object"},"sort":{"$ref":"#/components/schemas/SortExpression"},"summaries":{"$ref":"#/components/schemas/SummaryExpressionList"},"summariesFilter":{"$ref":"#/components/schemas/FilterExpression"}},"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SummarizeResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Summarize table","tags":["Search and Filter"]},"summary":"Summarize Table Data"},"/db/{db_branch_name}/tables/{table_name}/vectorSearch":{"description":"This endpoint can be used to perform vector-based similarity searches.\n","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"},{"$ref":"#/components/parameters/TableNameParam"}],"post":{"description":"This endpoint can be used to perform vector-based similarity searches in a table. \nIt can be used for implementing semantic search and product recommendation. To use this\nendpoint, you need a column of type vector. The input vector must have the same\ndimension as the vector column.\n","operationId":"vectorSearchTable","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"","properties":{"column":{"description":"The vector column in which to search. It must be of type `vector`.","type":"string"},"filter":{"$ref":"#/components/schemas/FilterExpression"},"queryVector":{"description":"The vector to search for similarities. Must have the same dimension as\nthe vector column used.\n","items":{"type":"number"},"type":"array"},"similarityFunction":{"default":"cosineSimilarity","description":"The function used to measure the distance between two points. Can be one of:\n`cosineSimilarity`, `l1`, `l2`. The default is `cosineSimilarity`.\n","type":"string"},"size":{"default":10,"description":"Number of results to return.","maximum":100,"minimum":1,"type":"integer"}},"required":["queryVector","column"],"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/SearchResponse"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Vector similarity search in a table","tags":["Search and Filter"]},"summary":"Vector similarity search"},"/db/{db_branch_name}/transaction":{"description":"Executes multiple operations together as one. This allows you to run a number of \noperations that succeed as a single group; or fail with no changes to your database.\n","parameters":[{"$ref":"#/components/parameters/DBBranchNameParam"}],"post":{"operationId":"branchTransaction","requestBody":{"content":{"application/json":{"schema":{"properties":{"operations":{"items":{"$ref":"#/components/schemas/TransactionOperation"},"type":"array"}},"required":["operations"],"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionSuccess"}}},"description":"Returns the results of a successful transaction."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionFailure"}}},"description":"Returns errors from a failed transaction."},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"429":{"$ref":"#/components/responses/RateLimitError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Execute a transaction on a branch","tags":["Records"]},"summary":"Execute a transaction on a branch"},"/dbs/{db_name}":{"description":"Given a parameter `db_name`, this path allows interacting with a specific database on Xata. Below are a number of operations that can be performed on a given database.","get":{"description":"List all available Branches","operationId":"getBranchList","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListBranchesResponse"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"$ref":"#/components/responses/SimpleError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"List branches","tags":["Branch"]},"parameters":[{"$ref":"#/components/parameters/DBNameParam"}],"summary":"Single Database"},"/dbs/{db_name}/gitBranches":{"delete":{"description":"Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.\n\nExample request:\n\n```json\n// DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123\n```\n","operationId":"removeGitBranchesEntry","parameters":[{"description":"The Git Branch to remove from the mapping","in":"query","name":"gitBranch","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"404":{"description":"The git branch was not found in the mapping"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Unlink a git branch to a Xata branch","tags":["Branch"]},"description":"This path allows managing the mapping between git and Xata branches, which is used by the `/dbs/{db_name}/resolveBranch` endpoint to resolve git branches to the associated Xata branches.\n","get":{"description":"Lists all the git branches in the mapping, and their associated Xata branches.\n\nExample response:\n\n```json\n{\n \"mappings\": [\n {\n \"gitBranch\": \"main\",\n \"xataBranch\": \"main\"\n },\n {\n \"gitBranch\": \"gitBranch1\",\n \"xataBranch\": \"xataBranch1\"\n }\n {\n \"gitBranch\": \"xataBranch2\",\n \"xataBranch\": \"xataBranch2\"\n }\n ]\n}\n```\n","operationId":"getGitBranchesMapping","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListGitBranchesResponse"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"List git branches mapping","tags":["Branch"]},"parameters":[{"$ref":"#/components/parameters/DBNameParam"}],"post":{"description":"Adds an entry to the mapping of git branches to Xata branches. The git branch and the Xata branch must be present in the body of the request. If the Xata branch doesn't exist, a 400 error is returned.\n\nIf the git branch is already present in the mapping, the old entry is overwritten, and a warning message is included in the response. If the git branch is added and didn't exist before, the response code is 204. If the git branch existed and it was overwritten, the response code is 201.\n\nExample request:\n\n```json\n// POST https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches\n{\n \"gitBranch\": \"fix/bug123\",\n \"xataBranch\": \"fix_bug\"\n}\n```\n","operationId":"addGitBranchesEntry","requestBody":{"content":{"application/json":{"schema":{"properties":{"gitBranch":{"description":"The name of the Git branch.","type":"string"},"xataBranch":{"$ref":"#/components/schemas/BranchName","description":"The name of the Xata branch."}},"required":["gitBranch","xataBranch"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"example":{"warning":"Git branch [fix/bug123] was already present in the mapping and was overwritten."},"properties":{"warning":{"description":"Warning message","type":"string"}},"type":"object"}}},"description":"Operation was successful with warnings"},"204":{"description":"Operation was successful without warnings"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Link a git branch to a Xata branch","tags":["Branch"]},"summary":"Mapping of git to Xata branches"},"/dbs/{db_name}/resolveBranch":{"description":"This endpoint is typically used by the Xata SDKs to resolve the correct branch to use in a particular situation. The main input is the git branch.","get":{"description":"In order to resolve the database branch, the following algorithm is used:\n* if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned\n* else, if a Xata branch with the exact same name as `gitBranch` exists, return it\n* else, if `fallbackBranch` is provided and a branch with that name exists, return it\n* else, return the default branch of the DB (`main` or the first branch)\n\nExample call:\n\n```json\n// GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test\u0026fallbackBranch=tsg\n```\n\nExample response:\n\n```json\n{\n \"branch\": \"main\",\n \"reason\": {\n \"code\": \"DEFAULT_BRANCH\",\n \"message\": \"Default branch for this database (main)\"\n }\n}\n```\n","operationId":"resolveBranch","parameters":[{"description":"The Git Branch","in":"query","name":"gitBranch","schema":{"type":"string"}},{"description":"Default branch to fallback to","in":"query","name":"fallbackBranch","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"example":{"branch":"main","reason":{"code":"DEFAULT_BRANCH","message":"Default branch for this database (main)"}},"properties":{"branch":{"type":"string"},"reason":{"properties":{"code":{"enum":["FOUND_IN_MAPPING","BRANCH_EXISTS","FALLBACK_BRANCH","DEFAULT_BRANCH"],"type":"string"},"message":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["branch","reason"],"type":"object"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/AuthError"},"5XX":{"description":"Unexpected Error"},"default":{"description":"Unexpected Error"}},"security":[{"bearerAuth":[]}],"summary":"Resolve a Git Branch to a Xata branch","tags":["Branch"]},"parameters":[{"$ref":"#/components/parameters/DBNameParam"}],"summary":"Resolve the branch to use"}},"components":{"parameters":{"BranchNameParam":{"description":"The Database Name","in":"path","name":"branch_name","required":true,"schema":{"$ref":"#/components/schemas/BranchName"}},"ChatSessionIDParam":{"in":"path","name":"session_id","required":true,"schema":{"maxLength":36,"minLength":36,"title":"SessionID","type":"string"}},"ColumnNameParam":{"description":"The Column name","in":"path","name":"column_name","required":true,"schema":{"$ref":"#/components/schemas/ColumnName"}},"ColumnsProjectionParam":{"description":"Column filters","explode":false,"in":"query","name":"columns","required":false,"schema":{"$ref":"#/components/schemas/ColumnsProjection"}},"DBBranchNameParam":{"description":"The DBBranchName matches the pattern `{db_name}:{branch_name}`.\n","in":"path","name":"db_branch_name","required":true,"schema":{"$ref":"#/components/schemas/DBBranchName"}},"DBNameParam":{"description":"The Database Name","in":"path","name":"db_name","required":true,"schema":{"$ref":"#/components/schemas/DBName"}},"FileAccessIDParam":{"description":"The File Access Identifier","in":"path","name":"file_id","required":true,"schema":{"$ref":"#/components/schemas/FileAccessID"}},"FileItemIDParam":{"description":"The File Identifier","in":"path","name":"file_id","required":true,"schema":{"$ref":"#/components/schemas/FileItemID"}},"FileSignatureParam":{"description":"File access signature","explode":false,"in":"query","name":"verify","required":false,"schema":{"$ref":"#/components/schemas/FileSignature"}},"RecordIDParam":{"description":"The Record name","in":"path","name":"record_id","required":true,"schema":{"$ref":"#/components/schemas/RecordID"}},"TableNameParam":{"description":"The Table name","in":"path","name":"table_name","required":true,"schema":{"$ref":"#/components/schemas/TableName"}}},"responses":{"AggResponse":{"content":{"application/json":{"schema":{"example":{"aggs":{"dailyUniqueUsers":{"values":[{"$count":321,"$key":"2022-02-22T22:22:22Z","uniqueUsers":134},{"$count":202,"$key":"2022-02-23T22:22:22Z","uniqueUsers":90}]}}},"properties":{"aggs":{"additionalProperties":{"$ref":"#/components/schemas/AggResponse"},"type":"object"}},"type":"object"}}},"description":"OK"},"AuthError":{"content":{"application/json":{"schema":{"example":{"message":"invalid API key"},"properties":{"id":{"type":"string"},"message":{"type":"string"}},"required":["message"],"type":"object"}}},"description":"Authentication Error"},"BadRequestError":{"content":{"application/json":{"schema":{"properties":{"id":{"type":"string"},"message":{"type":"string"}},"required":["message"],"type":"object"}}},"description":"Bad Request"},"BranchMigrationPlan":{"content":{"application/json":{"schema":{"properties":{"migration":{"$ref":"#/components/schemas/BranchMigration"},"version":{"type":"integer"}},"required":["version","migration"],"type":"object"}}},"description":"Example response"},"BulkError":{"content":{"application/json":{"schema":{"properties":{"errors":{"items":{"properties":{"message":{"type":"string"},"status":{"type":"integer"}},"type":"object"},"type":"array"}},"required":["errors"],"type":"object"}}},"description":"Response with multiple errors of the bulk execution"},"BulkInsertResponse":{"content":{"application/json":{"schema":{"oneOf":[{"properties":{"recordIDs":{"items":{"type":"string"},"type":"array"}},"required":["recordIDs"],"type":"object"},{"properties":{"records":{"items":{"$ref":"#/components/schemas/Record"},"type":"array"}},"required":["records"],"type":"object"}]}}},"description":"OK"},"PutFileResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}},"description":"OK"},"QueryResponse":{"content":{"application/json":{"schema":{"properties":{"meta":{"$ref":"#/components/schemas/RecordsMetadata"},"records":{"items":{"$ref":"#/components/schemas/Record"},"type":"array"}},"required":["records","meta"],"type":"object"}}},"description":"OK"},"RateLimitError":{"content":{"application/json":{"schema":{"properties":{"id":{"type":"string"},"message":{"type":"string"}},"required":["message"],"type":"object"}}},"description":"Rate limit exceeded"},"RecordResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record"}}},"description":"Table Record Reponse"},"RecordUpdateResponse":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Record"},{"properties":{"id":{"type":"string"},"xata":{"properties":{"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"}},"required":["version","createdAt","updatedAt"],"type":"object"}},"required":["id","xata"],"type":"object"}]}}},"description":"Record ID and metadata"},"SQLResponse":{"content":{"application/json":{"schema":{"properties":{"records":{"items":{"$ref":"#/components/schemas/SQLRecord"},"type":"array"},"warning":{"type":"string"}},"type":"object"}}},"description":"OK"},"SchemaCompareResponse":{"content":{"application/json":{"schema":{"properties":{"edits":{"$ref":"#/components/schemas/SchemaEditScript"},"source":{"$ref":"#/components/schemas/Schema"},"target":{"$ref":"#/components/schemas/Schema"}},"required":["source","target","edits"],"type":"object"}}},"description":"Schema comparison response."},"SchemaUpdateResponse":{"content":{"application/json":{"examples":{"example-1":{"value":{"migrationID":"mig_c7m19ilcefoebpqj12p0","parentMigrationID":"mig_c7m19ilcefoebpqj4312","status":"completed"}}},"schema":{"properties":{"migrationID":{"minLength":1,"type":"string"},"parentMigrationID":{"type":"string"},"status":{"$ref":"#/components/schemas/MigrationStatus"}},"required":["migrationID","parentMigrationID","status"],"type":"object"}}},"description":"Schema migration response with ID and migration status."},"SearchResponse":{"content":{"application/json":{"schema":{"properties":{"records":{"items":{"$ref":"#/components/schemas/Record"},"type":"array"},"totalCount":{"description":"The total count of records matched. It will be accurately returned up to 10000 records.","type":"integer"},"warning":{"type":"string"}},"required":["records","totalCount"],"type":"object"}}},"description":"OK"},"ServiceUnavailableError":{"content":{"application/json":{"schema":{"properties":{"id":{"type":"string"},"message":{"type":"string"}},"required":["message"],"type":"object"}}},"description":"ServiceUnavailable","headers":{"Retry-After":{"schema":{"description":"Number of seconds to wait after retrying the operation","type":"string"}}}},"SimpleError":{"content":{"application/json":{"schema":{"properties":{"id":{"type":"string"},"message":{"type":"string"}},"required":["message"],"type":"object"}}},"description":"Example response"},"SummarizeResponse":{"content":{"application/json":{"schema":{"properties":{"summaries":{"items":{"type":"object"},"type":"array"}},"required":["summaries"],"type":"object"}}},"description":"OK"}},"schemas":{"AggExpression":{"description":"The description of a single aggregation operation. It is an object with only one key-value pair.\nThe key represents the aggregation type, while the value is an object with the configuration of\nthe aggregation.\n","oneOf":[{"additionalProperties":false,"properties":{"count":{"$ref":"#/components/schemas/CountAgg"}},"type":"object"},{"additionalProperties":false,"properties":{"sum":{"$ref":"#/components/schemas/SumAgg"}},"type":"object"},{"additionalProperties":false,"properties":{"max":{"$ref":"#/components/schemas/MaxAgg"}},"type":"object"},{"additionalProperties":false,"properties":{"min":{"$ref":"#/components/schemas/MinAgg"}},"type":"object"},{"additionalProperties":false,"properties":{"average":{"$ref":"#/components/schemas/AverageAgg"}},"type":"object"},{"additionalProperties":false,"properties":{"uniqueCount":{"$ref":"#/components/schemas/UniqueCountAgg"}},"type":"object"},{"additionalProperties":false,"properties":{"dateHistogram":{"$ref":"#/components/schemas/DateHistogramAgg"}},"type":"object"},{"additionalProperties":false,"properties":{"topValues":{"$ref":"#/components/schemas/TopValuesAgg"}},"type":"object"},{"additionalProperties":false,"properties":{"numericHistogram":{"$ref":"#/components/schemas/NumericHistogramAgg"}},"type":"object"}]},"AggExpressionMap":{"additionalProperties":{"$ref":"#/components/schemas/AggExpression"},"description":"The description of the aggregations you wish to receive.\n","example":{"dailyActiveUsers":{"dateHistogram":{"aggs":{"uniqueUsers":{"uniqueCount":{"column":"userID"}}},"column":"date","interval":"1d"}},"totalCount":{"count":"*"}},"type":"object"},"AggResponse":{"oneOf":[{"nullable":true,"type":"number"},{"properties":{"values":{"items":{"additionalProperties":{"$ref":"#/components/schemas/AggResponse"},"properties":{"$count":{"type":"integer"},"$key":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["$key","$count"],"type":"object"},"type":"array"}},"required":["values"],"type":"object"}]},"AverageAgg":{"additionalProperties":false,"description":"The average of the numeric values in a particular column.","properties":{"column":{"description":"The column on which to compute the average. Must be a numeric type.","type":"string"}},"required":["column"],"type":"object"},"BoosterExpression":{"description":"Booster Expression","oneOf":[{"additionalProperties":false,"properties":{"valueBooster":{"$ref":"#/components/schemas/ValueBooster"}},"type":"object"},{"additionalProperties":false,"properties":{"numericBooster":{"$ref":"#/components/schemas/NumericBooster"}},"type":"object"},{"additionalProperties":false,"properties":{"dateBooster":{"$ref":"#/components/schemas/DateBooster"}},"type":"object"}]},"Branch":{"additionalProperties":false,"properties":{"createdAt":{"$ref":"#/components/schemas/DateTime"},"name":{"type":"string"}},"required":["name","createdAt"],"type":"object"},"BranchMetadata":{"description":"","example":{"branch":"feature-login","labels":["epic-100"],"repository":"github.com/my/repository","stage":"testing"},"properties":{"branch":{"$ref":"#/components/schemas/BranchName"},"labels":{"items":{"type":"string"},"type":"array"},"repository":{"minLength":1,"type":"string"},"stage":{"minLength":1,"type":"string"}},"type":"object"},"BranchMigration":{"properties":{"createdAt":{"$ref":"#/components/schemas/DateTime"},"id":{"type":"string"},"lastGitRevision":{"type":"string"},"localChanges":{"type":"boolean"},"newTableOrder":{"items":{"type":"string"},"type":"array"},"newTables":{"additionalProperties":{"$ref":"#/components/schemas/Table"},"type":"object"},"parentID":{"type":"string"},"removedTables":{"items":{"type":"string"},"type":"array"},"renamedTables":{"items":{"$ref":"#/components/schemas/TableRename"},"type":"array"},"status":{"type":"string"},"tableMigrations":{"additionalProperties":{"$ref":"#/components/schemas/TableMigration"},"type":"object"},"title":{"type":"string"}},"required":["status","localChanges","newTableOrder"],"title":"Migration","type":"object"},"BranchName":{"maxLength":255,"minLength":1,"pattern":"[a-zA-Z0-9_\\-~]+","title":"BranchName","type":"string"},"BranchOp":{"properties":{"createdAt":{"$ref":"#/components/schemas/DateTime"},"id":{"type":"string"},"message":{"type":"string"},"migration":{"$ref":"#/components/schemas/Commit"},"modifiedAt":{"$ref":"#/components/schemas/DateTime"},"parentID":{"type":"string"},"status":{"$ref":"#/components/schemas/MigrationStatus"},"title":{"type":"string"}},"required":["id","status","createdAt"],"type":"object"},"BranchWithCopyID":{"properties":{"branchName":{"$ref":"#/components/schemas/BranchName"},"copyID":{"type":"string"},"dbBranchID":{"type":"string"}},"required":["branchName","dbBranchID","copyID"],"title":"BranchWithCopyID","type":"object"},"Column":{"properties":{"columns":{"items":{"$ref":"#/components/schemas/Column"},"type":"array"},"defaultValue":{"type":"string"},"file":{"$ref":"#/components/schemas/ColumnFile"},"file[]":{"$ref":"#/components/schemas/ColumnFile"},"link":{"$ref":"#/components/schemas/ColumnLink"},"name":{"type":"string"},"notNull":{"type":"boolean"},"type":{"enum":["bool","int","float","string","text","email","multiple","link","object","datetime","vector","fileArray","file","json"],"type":"string"},"unique":{"type":"boolean"},"vector":{"$ref":"#/components/schemas/ColumnVector"}},"required":["name","type"],"title":"Column","type":"object"},"ColumnFile":{"additionalProperties":false,"properties":{"defaultPublicAccess":{"type":"boolean"}},"type":"object"},"ColumnLink":{"properties":{"table":{"type":"string"}},"required":["table"],"type":"object"},"ColumnMigration":{"properties":{"new":{"$ref":"#/components/schemas/Column"},"old":{"$ref":"#/components/schemas/Column"}},"required":["old","new"],"title":"ColumnMigration","type":"object"},"ColumnName":{"pattern":"[a-zA-Z0-9_\\-~\\.]+","title":"ColumnName","type":"string"},"ColumnOpAdd":{"properties":{"column":{"$ref":"#/components/schemas/Column"},"table":{"type":"string"}},"required":["table","column"],"type":"object"},"ColumnOpRemove":{"properties":{"column":{"type":"string"},"table":{"type":"string"}},"required":["table","column"],"type":"object"},"ColumnOpRename":{"properties":{"newName":{"type":"string"},"oldName":{"type":"string"},"table":{"type":"string"}},"required":["table","oldName","newName"],"type":"object"},"ColumnVector":{"additionalProperties":false,"properties":{"dimension":{"maximum":10000,"minimum":2,"type":"integer"}},"required":["dimension"],"type":"object"},"ColumnsProjection":{"example":["name","email","created_at"],"items":{"type":"string"},"type":"array"},"Commit":{"properties":{"checksum":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/DateTime"},"id":{"type":"string"},"mergeParentID":{"type":"string"},"message":{"type":"string"},"operations":{"items":{"$ref":"#/components/schemas/MigrationOp"},"type":"array"},"parentID":{"type":"string"},"title":{"type":"string"}},"required":["operations","id","createdAt","checksum"],"type":"object"},"CountAgg":{"description":"Count the number of records with an optional filter.","oneOf":[{"additionalProperties":false,"properties":{"filter":{"$ref":"#/components/schemas/FilterExpression"}},"type":"object"},{"description":"Use this form to count all records without any filter.","enum":["*"],"type":"string"}]},"DBBranch":{"properties":{"branchName":{"$ref":"#/components/schemas/BranchName"},"createdAt":{"$ref":"#/components/schemas/DateTime"},"databaseName":{"$ref":"#/components/schemas/DBName"},"id":{"type":"string"},"lastMigrationID":{"type":"string"},"metadata":{"$ref":"#/components/schemas/BranchMetadata"},"schema":{"$ref":"#/components/schemas/Schema"},"startedFrom":{"$ref":"#/components/schemas/StartedFromMetadata"},"version":{"type":"number"}},"required":["databaseName","branchName","createdAt","id","version","lastMigrationID","schema"],"title":"DBBranch","type":"object"},"DBBranchName":{"description":"The DBBranchName matches the pattern `{db_name}:{branch_name}`.\n","maxLength":511,"minLength":1,"pattern":"[a-zA-Z0-9_\\-~]+:[a-zA-Z0-9_\\-~]+","title":"Tuple of database and branch name","type":"string"},"DBName":{"maxLength":255,"minLength":1,"pattern":"[a-zA-Z0-9_\\-~]+","title":"DBName","type":"string"},"DataInputRecord":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/RecordID"},{"type":"string"},{"type":"boolean"},{"type":"number"},{"items":{"type":"string"},"type":"array"},{"items":{"type":"number"},"type":"array"},{"$ref":"#/components/schemas/DateTime"},{"$ref":"#/components/schemas/ObjectValue"},{"$ref":"#/components/schemas/InputFileArray"},{"$ref":"#/components/schemas/InputFile"}],"nullable":true},"description":"Xata input record","type":"object"},"DateBooster":{"additionalProperties":false,"description":"Boost records based on the value of a datetime column. It is configured via \"origin\", \"scale\", and \"decay\". The further away from the \"origin\",\nthe more the score is decayed. The decay function uses an exponential function. For example if origin is \"now\", and scale is 10 days and decay is 0.5, it\nshould be interpreted as: a record with a date 10 days before/after origin will be boosted 2 times less than a record with the date at origin.\nThe result of the exponential function is a boost between 0 and 1. The \"factor\" allows you to control how impactful this boost is, by multiplying it with a given value.\n","properties":{"column":{"description":"The column in which to look for the value.","type":"string"},"decay":{"description":"The decay factor to expect at \"scale\" distance from the \"origin\".","type":"number"},"factor":{"description":"The factor with which to multiply the added boost.","minimum":0,"type":"number"},"ifMatchesFilter":{"$ref":"#/components/schemas/FilterExpression","description":"Only apply this booster to the records for which the provided filter matches.\n"},"origin":{"description":"The datetime (formatted as RFC3339) from where to apply the score decay function. The maximum boost will be applied for records with values at this time.\nIf it is not specified, the current date and time is used.\n","type":"string"},"scale":{"description":"The duration at which distance from origin the score is decayed with factor, using an exponential function. It is formatted as number + units, for example: `5d`, `20m`, `10s`.\n","pattern":"^(\\d+)(d|h|m|s|ms)$","type":"string"}},"required":["column","scale","decay"]},"DateHistogramAgg":{"additionalProperties":false,"description":"Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.\n","properties":{"aggs":{"$ref":"#/components/schemas/AggExpressionMap"},"calendarInterval":{"description":"The calendar-aware interval to use when bucketing. Possible values are: `minute`,\n`hour`, `day`, `week`, `month`, `quarter`, `year`.\n","enum":["minute","hour","day","week","month","quarter","year"],"type":"string"},"column":{"description":"The column to use for bucketing. Must be of type datetime.","type":"string"},"interval":{"description":"The fixed interval to use when bucketing. \nIt is formatted as number + units, for example: `5d`, `20m`, `10s`.\n","pattern":"^(\\d+)(d|h|m|s|ms)$","type":"string"},"timezone":{"description":"The timezone to use for bucketing. By default, UTC is assumed.\nThe accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or\n`-08:00`.\n","pattern":"^[+-][01]\\d:[0-5]\\d$","type":"string"}},"required":["column"],"type":"object"},"DateTime":{"format":"date-time","title":"DateTime","type":"string"},"FileAccessID":{"description":"File identifier in access URLs","maxLength":296,"minLength":88,"pattern":"[a-v0-9=]+","title":"FileID","type":"string"},"FileItemID":{"description":"Unique file identifier","maxLength":255,"minLength":1,"pattern":"[a-zA-Z0-9_-~:]+","title":"FileID","type":"string"},"FileName":{"description":"File name","maxLength":1024,"minLength":0,"pattern":"[0-9a-zA-Z!\\-_\\.\\*'\\(\\)]*","type":"string"},"FileResponse":{"description":"File metadata","properties":{"attributes":{"type":"object"},"id":{"$ref":"#/components/schemas/FileItemID"},"mediaType":{"$ref":"#/components/schemas/MediaType"},"name":{"$ref":"#/components/schemas/FileName"},"size":{"format":"int64","type":"integer"},"version":{"format":"int64","type":"integer"}},"required":["name","mediaType","size","version"],"type":"object"},"FileSignature":{"description":"File signature","type":"string"},"FilterColumn":{"anyOf":[{"$ref":"#/components/schemas/FilterColumnIncludes"},{"$ref":"#/components/schemas/FilterPredicate"},{"$ref":"#/components/schemas/FilterList"}]},"FilterColumnIncludes":{"additionalProperties":false,"maxProperties":1,"minProperties":1,"properties":{"$includes":{"$ref":"#/components/schemas/FilterPredicate"},"$includesAll":{"$ref":"#/components/schemas/FilterPredicate"},"$includesAny":{"$ref":"#/components/schemas/FilterPredicate"},"$includesNone":{"$ref":"#/components/schemas/FilterPredicate"}},"type":"object"},"FilterExpression":{"additionalProperties":{"$ref":"#/components/schemas/FilterColumn"},"minProperties":1,"properties":{"$all":{"$ref":"#/components/schemas/FilterList"},"$any":{"$ref":"#/components/schemas/FilterList"},"$exists":{"type":"string"},"$existsNot":{"type":"string"},"$none":{"$ref":"#/components/schemas/FilterList"},"$not":{"$ref":"#/components/schemas/FilterList"}},"type":"object"},"FilterList":{"oneOf":[{"$ref":"#/components/schemas/FilterExpression"},{"items":{"$ref":"#/components/schemas/FilterExpression"},"type":"array"}]},"FilterPredicate":{"oneOf":[{"$ref":"#/components/schemas/FilterValue"},{"items":{"$ref":"#/components/schemas/FilterPredicate"},"minLength":1,"type":"array"},{"$ref":"#/components/schemas/FilterPredicateOp"},{"$ref":"#/components/schemas/FilterPredicateRangeOp"}]},"FilterPredicateOp":{"additionalProperties":false,"maxProperties":1,"minProperties":1,"properties":{"$all":{"oneOf":[{"items":{"$ref":"#/components/schemas/FilterPredicate"},"type":"array"}]},"$any":{"oneOf":[{"items":{"$ref":"#/components/schemas/FilterPredicate"},"type":"array"}]},"$contains":{"type":"string"},"$endsWith":{"type":"string"},"$ge":{"$ref":"#/components/schemas/FilterRangeValue"},"$gt":{"$ref":"#/components/schemas/FilterRangeValue"},"$is":{"oneOf":[{"$ref":"#/components/schemas/FilterValue"},{"items":{"$ref":"#/components/schemas/FilterValue"},"type":"array"}]},"$isNot":{"oneOf":[{"$ref":"#/components/schemas/FilterValue"},{"items":{"$ref":"#/components/schemas/FilterValue"},"type":"array"}]},"$le":{"$ref":"#/components/schemas/FilterRangeValue"},"$lt":{"$ref":"#/components/schemas/FilterRangeValue"},"$none":{"oneOf":[{"$ref":"#/components/schemas/FilterPredicate"},{"items":{"$ref":"#/components/schemas/FilterPredicate"},"type":"array"}]},"$not":{"oneOf":[{"$ref":"#/components/schemas/FilterPredicate"},{"items":{"$ref":"#/components/schemas/FilterPredicate"},"type":"array"}]},"$pattern":{"type":"string"},"$startsWith":{"type":"string"}},"type":"object"},"FilterPredicateRangeOp":{"additionalProperties":false,"maxProperties":2,"minProperties":2,"properties":{"$ge":{"$ref":"#/components/schemas/FilterRangeValue"},"$gt":{"$ref":"#/components/schemas/FilterRangeValue"},"$le":{"$ref":"#/components/schemas/FilterRangeValue"},"$lt":{"$ref":"#/components/schemas/FilterRangeValue"}},"type":"object"},"FilterRangeValue":{"oneOf":[{"type":"number"},{"type":"string"}]},"FilterValue":{"oneOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}]},"FuzzinessExpression":{"default":1,"description":"Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein\ndistance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single\ncharacter typos per word are tolerated by search. You can set it to 0 to remove the typo tolerance or set it to 2\nto allow two typos in a word.\n","maximum":2,"minimum":0,"type":"integer"},"HighlightExpression":{"additionalProperties":false,"properties":{"enabled":{"description":"Set to `false` to disable highlighting. By default it is `true`.\n","type":"boolean"},"encodeHTML":{"description":"Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.\n","type":"boolean"}},"type":"object"},"InputFile":{"additionalProperties":false,"description":"Object representing a file","properties":{"base64Content":{"description":"Base64 encoded content","maxLength":20971520,"type":"string"},"enablePublicUrl":{"description":"Enable public access to the file","type":"boolean"},"mediaType":{"$ref":"#/components/schemas/MediaType"},"name":{"$ref":"#/components/schemas/FileName"},"signedUrlTimeout":{"description":"Time to live for signed URLs","type":"integer"}},"required":["name"],"type":"object"},"InputFileArray":{"description":"Array of file entries","items":{"$ref":"#/components/schemas/InputFileEntry"},"maxItems":50,"type":"array"},"InputFileEntry":{"additionalProperties":false,"description":"Object representing a file in an array","properties":{"base64Content":{"description":"Base64 encoded content","maxLength":20971520,"type":"string"},"enablePublicUrl":{"description":"Enable public access to the file","type":"boolean"},"id":{"$ref":"#/components/schemas/FileItemID"},"mediaType":{"$ref":"#/components/schemas/MediaType"},"name":{"$ref":"#/components/schemas/FileName"},"signedUrlTimeout":{"description":"Time to live for signed URLs","type":"integer"}}},"ListBranchesResponse":{"additionalProperties":false,"properties":{"branches":{"items":{"$ref":"#/components/schemas/Branch"},"type":"array"},"databaseName":{"type":"string"}},"required":["databaseName","branches"],"type":"object"},"ListGitBranchesResponse":{"properties":{"mapping":{"items":{"properties":{"gitBranch":{"type":"string"},"xataBranch":{"type":"string"}},"required":["gitBranch","xataBranch"],"type":"object"},"type":"array"}},"required":["mapping"],"type":"object"},"MaxAgg":{"additionalProperties":false,"description":"The max of the numeric values in a particular column.","properties":{"column":{"description":"The column on which to compute the max. Must be a numeric type.","type":"string"}},"required":["column"],"type":"object"},"MediaType":{"description":"Media type","maxLength":255,"minLength":3,"pattern":"^\\w+/[-+.\\w]+$","type":"string"},"MetricsDatapoint":{"properties":{"timestamp":{"type":"string"},"value":{"type":"integer"}},"required":["timestamp","value"],"title":"Datapoint","type":"object"},"MetricsLatency":{"properties":{"p50":{"items":{"$ref":"#/components/schemas/MetricsDatapoint"},"type":"array"},"p90":{"items":{"$ref":"#/components/schemas/MetricsDatapoint"},"type":"array"}},"title":"MetricsLatency","type":"object"},"Migration":{"description":"Branch schema migration.","properties":{"operations":{"items":{"$ref":"#/components/schemas/MigrationOp"},"type":"array"},"parentID":{"type":"string"}},"required":["operations"],"type":"object"},"MigrationColumnOp":{"oneOf":[{"additionalProperties":false,"properties":{"addColumn":{"$ref":"#/components/schemas/ColumnOpAdd"}},"required":["addColumn"],"type":"object"},{"additionalProperties":false,"properties":{"removeColumn":{"$ref":"#/components/schemas/ColumnOpRemove"}},"required":["removeColumn"],"type":"object"},{"additionalProperties":false,"properties":{"renameColumn":{"$ref":"#/components/schemas/ColumnOpRename"}},"required":["renameColumn"],"type":"object"}]},"MigrationObject":{"properties":{"checksum":{"type":"string"},"id":{"type":"string"},"message":{"type":"string"},"operations":{"items":{"$ref":"#/components/schemas/MigrationOp"},"type":"array"},"parentID":{"type":"string"},"title":{"type":"string"}},"required":["operations","id","checksum"],"type":"object"},"MigrationOp":{"description":"Branch schema migration operations.","oneOf":[{"$ref":"#/components/schemas/MigrationTableOp"},{"$ref":"#/components/schemas/MigrationColumnOp"}]},"MigrationRequest":{"additionalProperties":false,"properties":{"body":{"description":"The migration request body with detailed description.","type":"string"},"closedAt":{"$ref":"#/components/schemas/DateTime","description":"Timestamp when the migration request was closed."},"createdAt":{"$ref":"#/components/schemas/DateTime","description":"Migration request creation timestamp."},"mergedAt":{"$ref":"#/components/schemas/DateTime","description":"Timestamp when the migration request was merged."},"modifiedAt":{"$ref":"#/components/schemas/DateTime","description":"Last modified timestamp."},"number":{"$ref":"#/components/schemas/MigrationRequestNumber"},"source":{"description":"Name of the source branch.","type":"string"},"status":{"enum":["open","closed","merging","merged","failed"],"type":"string"},"target":{"description":"Name of the target branch.","type":"string"},"title":{"description":"The migration request title.","type":"string"}},"type":"object"},"MigrationRequestNumber":{"description":"The migration request number.","minimum":0,"type":"integer"},"MigrationStatus":{"enum":["completed","pending","failed"],"type":"string"},"MigrationTableOp":{"oneOf":[{"additionalProperties":false,"properties":{"addTable":{"$ref":"#/components/schemas/TableOpAdd"}},"required":["addTable"],"type":"object"},{"additionalProperties":false,"properties":{"removeTable":{"$ref":"#/components/schemas/TableOpRemove"}},"required":["removeTable"],"type":"object"},{"additionalProperties":false,"properties":{"renameTable":{"$ref":"#/components/schemas/TableOpRename"}},"required":["renameTable"],"type":"object"}]},"MinAgg":{"additionalProperties":false,"description":"The min of the numeric values in a particular column.","properties":{"column":{"description":"The column on which to compute the min. Must be a numeric type.","type":"string"}},"required":["column"],"type":"object"},"NumericBooster":{"additionalProperties":false,"description":"Boost records based on the value of a numeric column.","properties":{"column":{"description":"The column in which to look for the value.","type":"string"},"factor":{"description":"The factor with which to multiply the value of the column before adding it to the item score.","type":"number"},"ifMatchesFilter":{"$ref":"#/components/schemas/FilterExpression","description":"Only apply this booster to the records for which the provided filter matches.\n"},"modifier":{"description":"Modifier to be applied to the column value, before being multiplied with the factor. The possible values are:\n - none (default).\n - log: common logarithm (base 10)\n - log1p: add 1 then take the common logarithm. This ensures that the value is positive if the\n value is between 0 and 1.\n - ln: natural logarithm (base e)\n - ln1p: add 1 then take the natural logarithm. This ensures that the value is positive if the\n value is between 0 and 1.\n - square: raise the value to the power of two.\n - sqrt: take the square root of the value.\n - reciprocal: reciprocate the value (if the value is `x`, the reciprocal is `1/x`).\n","enum":["none","log","log1p","ln","ln1p","square","sqrt","reciprocal"],"type":"string"}},"required":["column","factor"],"type":"object"},"NumericHistogramAgg":{"additionalProperties":false,"description":"Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.\n","properties":{"aggs":{"$ref":"#/components/schemas/AggExpressionMap"},"column":{"description":"The column to use for bucketing. Must be of numeric type.","type":"string"},"interval":{"description":"The numeric interval to use for bucketing. The resulting buckets will be ranges \nwith this value as size.\n","minimum":0,"type":"number"},"offset":{"default":0,"description":"By default the bucket keys start with 0 and then continue in `interval` steps. The bucket\nboundaries can be shifted by using the offset option. For example, if the `interval` is 100,\nbut you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset` \nto 50.\n","type":"number"}},"required":["column","interval"]},"ObjectValue":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"items":{"type":"string"},"type":"array"},{"items":{"type":"number"},"type":"array"},{"$ref":"#/components/schemas/DateTime"},{"$ref":"#/components/schemas/ObjectValue"}]},"description":"Object column value","type":"object"},"PageConfig":{"description":"Pagination settings.","properties":{"after":{"description":"Query the next page that follow the cursor.","type":"string"},"before":{"description":"Query the previous page before the cursor.","type":"string"},"end":{"description":"Query the last page from the cursor.","type":"string"},"offset":{"default":0,"description":"Use offset to skip entries. To skip pages set offset to a multiple of size.","type":"integer"},"size":{"default":20,"description":"Set page size. If the size is missing it is read from the cursor. If no cursor is given Xata will choose the default page size.","type":"integer"},"start":{"description":"Query the first page from the cursor.","type":"string"}},"title":"PageConfig","type":"object"},"PrefixExpression":{"description":"If the prefix type is set to \"disabled\" (the default), the search only matches full words. If the prefix type is set to \"phrase\", the search will return results that match prefixes of the search phrase.\n","enum":["phrase","disabled"],"type":"string"},"ProjectionConfig":{"description":"A structured projection that allows for some configuration.","properties":{"as":{"description":"An alias for the projected field, this is how it will be returned in the response.","type":"string"},"columns":{"$ref":"#/components/schemas/QueryColumnsProjection"},"limit":{"default":20,"type":"integer"},"name":{"description":"The name of the column to project or a reverse link specification, see [API Guide](https://xata.io/docs/concepts/data-model#links-and-relations).","type":"string"},"offset":{"default":0,"type":"integer"},"sort":{"$ref":"#/components/schemas/SortExpression"}},"type":"object"},"QueryColumnsProjection":{"items":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/ProjectionConfig"}]},"type":"array"},"Record":{"allOf":[{"$ref":"#/components/schemas/RecordMeta"},{"additionalProperties":true,"type":"object"}],"description":"Xata Table Record","title":"Record"},"RecordID":{"maxLength":255,"minLength":1,"pattern":"[a-zA-Z0-9_-~:]+","title":"RecordID","type":"string"},"RecordMeta":{"description":"Xata Table Record Metadata","properties":{"id":{"$ref":"#/components/schemas/RecordID"},"xata":{"properties":{"createdAt":{"description":"The time when the record was created.","type":"string"},"highlight":{"additionalProperties":{"oneOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":true,"type":"object"}]},"description":"Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.","type":"object"},"score":{"description":"The record's relevancy score. This is returned by the search APIs.","type":"number"},"table":{"description":"The record's table name. APIs that return records from multiple tables will set this field accordingly.","type":"string"},"updatedAt":{"description":"The time when the record was last updated.","type":"string"},"version":{"description":"The record's version. Can be used for optimistic concurrency control.","type":"integer"},"warnings":{"description":"Encoding/Decoding errors","items":{"type":"string"},"type":"array"}},"required":["version"],"type":"object"}},"required":["id","xata"],"title":"RecordMeta","type":"object"},"RecordsMetadata":{"description":"Records metadata","properties":{"page":{"properties":{"cursor":{"description":"last record id","type":"string"},"more":{"description":"true if more records can be fetched","type":"boolean"},"size":{"description":"the number of records returned per page","type":"number"}},"required":["cursor","more","size"],"type":"object"}},"required":["page"],"type":"object"},"RevLink":{"properties":{"column":{"type":"string"},"table":{"type":"string"}},"required":["table","column"],"title":"RevLink","type":"object"},"SQLRecord":{"allOf":[{"additionalProperties":true,"type":"object"}],"description":"Xata Table SQL Record","title":"SQL Record"},"Schema":{"properties":{"tables":{"items":{"$ref":"#/components/schemas/Table"},"type":"array"},"tablesOrder":{"items":{"type":"string"},"type":"array"}},"required":["tables"],"title":"Schema","type":"object"},"SchemaEditScript":{"properties":{"operations":{"items":{"$ref":"#/components/schemas/MigrationOp"},"type":"array"},"sourceMigrationID":{"type":"string"},"targetMigrationID":{"type":"string"}},"required":["operations"],"title":"SchemaEditScript","type":"object"},"SearchPageConfig":{"description":"Pagination settings for the search endpoints.","properties":{"offset":{"default":0,"description":"Use offset to skip entries. To skip pages set offset to a multiple of size.","maximum":800,"type":"integer"},"size":{"default":25,"description":"Set page size.","maximum":200,"type":"integer"}},"title":"SearchPageConfig"},"SortExpression":{"oneOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":{"$ref":"#/components/schemas/SortOrder"},"type":"object"},{"items":{"additionalProperties":{"$ref":"#/components/schemas/SortOrder"},"type":"object"},"type":"array"}],"title":"SortExpression"},"SortOrder":{"enum":["asc","desc","random"],"title":"SortOrder","type":"string"},"StartedFromMetadata":{"properties":{"branchName":{"$ref":"#/components/schemas/BranchName"},"dbBranchID":{"type":"string"},"migrationID":{"type":"string"}},"required":["branchName","dbBranchID","migrationID"],"title":"StartedFromMetadata","type":"object"},"SumAgg":{"additionalProperties":false,"description":"The sum of the numeric values in a particular column.","properties":{"column":{"description":"The column on which to compute the sum. Must be a numeric type.","type":"string"}},"required":["column"],"type":"object"},"SummaryExpression":{"description":"A summary expression is the description of a single summary operation. It consists of a single\nkey representing the operation, and a value representing the column to be operated on.\n\nThe column being summarized cannot be an internal column (id, xata.*), nor the base of\nan object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize\n`settings.dark_mode` but not `settings` nor `settings.*`.\n\nWe currently support several aggregation functions. Not all functions can be run on all column\ntypes.\n\n - `count` is used to count the number of records in each group. Use `{\"count\": \"*\"}` to count\n all columns present, otherwise `{\"count\": \"\u003ccolumn_path\u003e\"}` to count the number of non-null\n values are present at column path.\n\n Count can be used on any column type, and always returns an int.\n\n - `min` calculates the minimum value in each group. `min` is compatible with most types;\n string, multiple, text, email, int, float, and datetime. It returns a value of the same\n type as operated on. This means that `{\"lowest_latency\": {\"min\": \"latency\"}}` where\n `latency` is an int, will always return an int.\n\n - `max` calculates the maximum value in each group. `max` shares the same compatibility as\n `min`.\n\n - `sum` adds up all values in a group. `sum` can be run on `int` and `float` types, and will\n return a value of the same type as requested.\n\n - `average` averages all values in a group. `average` can be run on `int` and `float` types, and\n always returns a float.\n","example":{"count":"deleted_at"},"type":"object"},"SummaryExpressionList":{"additionalProperties":{"$ref":"#/components/schemas/SummaryExpression"},"description":"The description of the summaries you wish to receive. Set each key to be the field name\nyou'd like for the summary. These names must not collide with other columns you've\nrequested from `columns`; including implicit requests like `settings.*`.\n\nThe value for each key needs to be an object. This object should contain one key and one \nvalue only. In this object, the key should be set to the summary function you wish to use\nand the value set to the column name to be summarized.\n\nThe column being summarized cannot be an internal column (id, xata.*), nor the base of\nan object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize\n`settings.dark_mode` but not `settings` nor `settings.*`.\n","example":{"all_users":{"count":"*"},"average_speed":{"average":"speed"},"max_happiness":{"max":"happiness"},"min_cost":{"min":"cost"},"total_created":{"count":"created_at"},"total_revenue":{"sum":"revenue"}},"type":"object"},"Table":{"properties":{"columns":{"items":{"$ref":"#/components/schemas/Column"},"type":"array"},"id":{"type":"string"},"name":{"$ref":"#/components/schemas/TableName"},"revLinks":{"items":{"$ref":"#/components/schemas/RevLink"},"type":"array"}},"required":["name","columns"],"title":"Table","type":"object"},"TableMigration":{"properties":{"modifiedColumns":{"items":{"$ref":"#/components/schemas/ColumnMigration"},"type":"array"},"newColumnOrder":{"items":{"type":"string"},"type":"array"},"newColumns":{"additionalProperties":{"$ref":"#/components/schemas/Column"},"type":"object"},"removedColumns":{"items":{"type":"string"},"type":"array"}},"required":["newColumnOrder"],"title":"TableMigration","type":"object"},"TableName":{"maxLength":255,"minLength":1,"pattern":"[a-zA-Z0-9_\\-~]+","title":"TableName","type":"string"},"TableOpAdd":{"properties":{"table":{"type":"string"}},"required":["table"],"type":"object"},"TableOpRemove":{"properties":{"table":{"type":"string"}},"required":["table"],"type":"object"},"TableOpRename":{"properties":{"newName":{"type":"string"},"oldName":{"type":"string"}},"required":["oldName","newName"],"type":"object"},"TableRename":{"description":"","example":{"newName":"newName","oldName":"oldName"},"properties":{"newName":{"minLength":1,"type":"string"},"oldName":{"minLength":1,"type":"string"}},"required":["newName","oldName"],"type":"object"},"TargetExpression":{"description":"The target expression is used to filter the search results by the target columns.\n","items":{"oneOf":[{"type":"string"},{"additionalProperties":false,"properties":{"column":{"description":"The name of the column.","type":"string"},"weight":{"default":1,"description":"The weight of the column.","maximum":10,"minimum":1,"type":"number"}},"required":["column"],"type":"object"}]},"type":"array"},"TopValuesAgg":{"additionalProperties":false,"description":"Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.\nThe top values as ordered by the number of records (`$count`) are returned.\n","properties":{"aggs":{"$ref":"#/components/schemas/AggExpressionMap"},"column":{"description":"The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.","type":"string"},"size":{"default":10,"description":"The maximum number of unique values to return.\n","maximum":1000,"type":"integer"}},"required":["column"]},"TransactionDeleteOp":{"description":"A delete operation. The transaction will continue if no record matches the ID by default. To override this behaviour, set failIfMissing to true.","properties":{"columns":{"description":"If set, the call will return the requested fields as part of the response.","items":{"type":"string"},"type":"array"},"failIfMissing":{"description":"If true, the transaction will fail when the record doesn't exist.","type":"boolean"},"id":{"$ref":"#/components/schemas/RecordID"},"table":{"description":"The table name","type":"string"}},"required":["table","id"],"type":"object"},"TransactionError":{"description":"An error message from a failing transaction operation","properties":{"index":{"description":"The index of the failing operation","type":"integer"},"message":{"description":"The error message","type":"string"}},"required":["index","message"],"type":"object"},"TransactionFailure":{"description":"An array of errors, with indices, from the transaction.","properties":{"errors":{"description":"An array of errors from the submitted operations.","items":{"$ref":"#/components/schemas/TransactionError"},"type":"array"},"id":{"description":"The request ID.","type":"string"}},"required":["id","errors"],"type":"object"},"TransactionGetOp":{"description":"Get by id operation.","properties":{"columns":{"description":"If set, the call will return the requested fields as part of the response.","items":{"type":"string"},"type":"array"},"id":{"$ref":"#/components/schemas/RecordID"},"table":{"description":"The table name","type":"string"}},"required":["table","id"],"type":"object"},"TransactionInsertOp":{"description":"Insert operation","properties":{"columns":{"description":"If set, the call will return the requested fields as part of the response.","items":{"type":"string"},"type":"array"},"createOnly":{"description":"createOnly is used to change how Xata acts when an explicit ID is set in the `record` key. \n\nIf `createOnly` is set to `true`, Xata will only attempt to insert the record. If there's a conflict, Xata \nwill cancel the transaction. \n\nIf `createOnly` is set to `false`, Xata will attempt to insert the record. If there's no\nconflict, the record is inserted. If there is a conflict, Xata will replace the record.\n","type":"boolean"},"ifVersion":{"description":"The version of the record you expect to be overwriting. Only valid with an\nexplicit ID is also set in the `record` key.\n","type":"integer"},"record":{"additionalProperties":true,"description":"The record to insert. The `id` field is optional; when specified, it will be used as the ID for the record.\n","type":"object"},"table":{"description":"The table name","type":"string"}},"required":["table","record"],"type":"object"},"TransactionOperation":{"description":"A transaction operation","oneOf":[{"properties":{"insert":{"$ref":"#/components/schemas/TransactionInsertOp"}},"required":["insert"],"type":"object"},{"properties":{"update":{"$ref":"#/components/schemas/TransactionUpdateOp"}},"required":["update"],"type":"object"},{"properties":{"delete":{"$ref":"#/components/schemas/TransactionDeleteOp"}},"required":["delete"],"type":"object"},{"properties":{"get":{"$ref":"#/components/schemas/TransactionGetOp"}},"required":["get"],"type":"object"}],"type":"object"},"TransactionResultColumns":{"additionalProperties":true,"description":"Fields to return in the transaction result.","type":"object"},"TransactionResultDelete":{"description":"A result from a delete operation.","properties":{"columns":{"$ref":"#/components/schemas/TransactionResultColumns"},"operation":{"description":"The type of operation who's result is being returned.","enum":["delete"],"type":"string"},"rows":{"description":"The number of deleted rows","type":"integer"}},"required":["operation","rows"],"type":"object"},"TransactionResultGet":{"description":"A result from a get operation.","properties":{"columns":{"$ref":"#/components/schemas/TransactionResultColumns"},"operation":{"description":"The type of operation who's result is being returned.","enum":["get"],"type":"string"}},"required":["operation"],"type":"object"},"TransactionResultInsert":{"description":"A result from an insert operation.","properties":{"columns":{"$ref":"#/components/schemas/TransactionResultColumns"},"id":{"$ref":"#/components/schemas/RecordID"},"operation":{"description":"The type of operation who's result is being returned.","enum":["insert"],"type":"string"},"rows":{"description":"The number of affected rows","type":"integer"}},"required":["operation","rows","id"],"type":"object"},"TransactionResultUpdate":{"description":"A result from an update operation.","properties":{"columns":{"$ref":"#/components/schemas/TransactionResultColumns"},"id":{"$ref":"#/components/schemas/RecordID"},"operation":{"description":"The type of operation who's result is being returned.","enum":["update"],"type":"string"},"rows":{"description":"The number of updated rows","type":"integer"}},"required":["operation","rows","id"],"type":"object"},"TransactionSuccess":{"description":"An ordered array of results from the submitted operations.","properties":{"results":{"items":{"oneOf":[{"$ref":"#/components/schemas/TransactionResultInsert"},{"$ref":"#/components/schemas/TransactionResultUpdate"},{"$ref":"#/components/schemas/TransactionResultDelete"},{"$ref":"#/components/schemas/TransactionResultGet"}]},"type":"array"}},"required":["results"],"type":"object"},"TransactionUpdateOp":{"description":"Update operation","properties":{"columns":{"description":"If set, the call will return the requested fields as part of the response.","items":{"type":"string"},"type":"array"},"fields":{"additionalProperties":true,"description":"The fields of the record you'd like to update","type":"object"},"id":{"$ref":"#/components/schemas/RecordID"},"ifVersion":{"description":"The version of the record you expect to be updating","type":"integer"},"table":{"description":"The table name","type":"string"},"upsert":{"description":"Xata will insert this record if it cannot be found.","type":"boolean"}},"required":["table","id","fields"],"type":"object"},"UniqueCountAgg":{"additionalProperties":false,"description":"Count the number of distinct values in a particular column.","properties":{"column":{"description":"The column from where to count the unique values.","type":"string"},"precisionThreshold":{"description":"The threshold under which the unique count is exact. If the number of unique\nvalues in the column is higher than this threshold, the results are approximate.\nMaximum value is 40,000, default value is 3000.\n","type":"integer"}},"required":["column"],"type":"object"},"ValueBooster":{"additionalProperties":false,"description":"Boost records with a particular value for a column.","properties":{"column":{"description":"The column in which to look for the value.","type":"string"},"factor":{"description":"The factor with which to multiply the added boost.","type":"number"},"ifMatchesFilter":{"$ref":"#/components/schemas/FilterExpression","description":"Only apply this booster to the records for which the provided filter matches.\n"},"value":{"description":"The exact value to boost.","oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"required":["column","value","factor"],"type":"object"}},"securitySchemes":{"bearerAuth":{"scheme":"bearer","type":"http"}}},"tags":[{"description":"Database management.","name":"Database","x-displayName":"Database"},{"description":"Branch management.","name":"Branch","x-displayName":"Branch"},{"description":"Branch schema migrations and history.","name":"Migrations","x-displayName":"Migrations"},{"description":"Table management.","name":"Table","x-displayName":"Table"},{"name":"xbregion_other","x-displayName":"other"},{"description":"Record access API.","name":"Records","x-displayName":"Records"},{"description":"APIs for searching, querying, filtering, and aggregating records.","name":"Search and Filter","x-displayName":"Search and Filter"},{"description":"CRUD API for operating on binary content in file and file[] columns.","name":"Files","x-displayName":"Files"},{"name":"xbcell_other","x-displayName":"other"},{"description":"SQL service access","name":"SQL","x-displayName":"SQL"},{"name":"sql_other","x-displayName":"other"}],"x-tagGroups":[{"description":"Xata.io Xatabases API","name":"xbregion","tags":["Database","Branch","Migrations","Table","Migration Requests","xbregion_other"]},{"description":"Xata.io Xatabases API","name":"xbcell","tags":["Records","Search and Filter","Files","xbcell_other"]},{"description":"Xata.io SQL API","name":"sql","tags":["SQL","sql_other"]}]}
\ No newline at end of file
diff --git a/xata/internal/fern-workspace/generated/go/add_git_branches_entry_request.go b/xata/internal/fern-workspace/generated/go/add_git_branches_entry_request.go
deleted file mode 100644
index 866854e..0000000
--- a/xata/internal/fern-workspace/generated/go/add_git_branches_entry_request.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// AddGitBranchesEntryRequest is an in-lined request used by the AddGitBranchesEntry endpoint.
-type AddGitBranchesEntryRequest struct {
- // The name of the Git branch.
- GitBranch string `json:"gitBranch"`
- XataBranch BranchName `json:"xataBranch"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/add_git_branches_entry_response.go b/xata/internal/fern-workspace/generated/go/add_git_branches_entry_response.go
deleted file mode 100644
index ce72286..0000000
--- a/xata/internal/fern-workspace/generated/go/add_git_branches_entry_response.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AddGitBranchesEntryResponse struct {
- // Warning message
- Warning *string `json:"warning,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/add_table_column_response.go b/xata/internal/fern-workspace/generated/go/add_table_column_response.go
deleted file mode 100644
index 0640246..0000000
--- a/xata/internal/fern-workspace/generated/go/add_table_column_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AddTableColumnResponse struct {
- // `non-empty`
- MigrationId string `json:"migrationID"`
- ParentMigrationId string `json:"parentMigrationID"`
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression.go b/xata/internal/fern-workspace/generated/go/agg_expression.go
deleted file mode 100644
index 4ac0b02..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression.go
+++ /dev/null
@@ -1,180 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-// The description of a single aggregation operation. It is an object with only one key-value pair.
-// The key represents the aggregation type, while the value is an object with the configuration of
-// the aggregation.
-type AggExpression struct {
- typeName string
- AggExpressionCount *AggExpressionCount
- AggExpressionSum *AggExpressionSum
- AggExpressionMax *AggExpressionMax
- AggExpressionMin *AggExpressionMin
- AggExpressionAverage *AggExpressionAverage
- AggExpressionUniqueCount *AggExpressionUniqueCount
- AggExpressionDateHistogram *AggExpressionDateHistogram
- AggExpressionTopValues *AggExpressionTopValues
- AggExpressionNumericHistogram *AggExpressionNumericHistogram
-}
-
-func NewAggExpressionFromAggExpressionCount(value *AggExpressionCount) *AggExpression {
- return &AggExpression{typeName: "aggExpressionCount", AggExpressionCount: value}
-}
-
-func NewAggExpressionFromAggExpressionSum(value *AggExpressionSum) *AggExpression {
- return &AggExpression{typeName: "aggExpressionSum", AggExpressionSum: value}
-}
-
-func NewAggExpressionFromAggExpressionMax(value *AggExpressionMax) *AggExpression {
- return &AggExpression{typeName: "aggExpressionMax", AggExpressionMax: value}
-}
-
-func NewAggExpressionFromAggExpressionMin(value *AggExpressionMin) *AggExpression {
- return &AggExpression{typeName: "aggExpressionMin", AggExpressionMin: value}
-}
-
-func NewAggExpressionFromAggExpressionAverage(value *AggExpressionAverage) *AggExpression {
- return &AggExpression{typeName: "aggExpressionAverage", AggExpressionAverage: value}
-}
-
-func NewAggExpressionFromAggExpressionUniqueCount(value *AggExpressionUniqueCount) *AggExpression {
- return &AggExpression{typeName: "aggExpressionUniqueCount", AggExpressionUniqueCount: value}
-}
-
-func NewAggExpressionFromAggExpressionDateHistogram(value *AggExpressionDateHistogram) *AggExpression {
- return &AggExpression{typeName: "aggExpressionDateHistogram", AggExpressionDateHistogram: value}
-}
-
-func NewAggExpressionFromAggExpressionTopValues(value *AggExpressionTopValues) *AggExpression {
- return &AggExpression{typeName: "aggExpressionTopValues", AggExpressionTopValues: value}
-}
-
-func NewAggExpressionFromAggExpressionNumericHistogram(value *AggExpressionNumericHistogram) *AggExpression {
- return &AggExpression{typeName: "aggExpressionNumericHistogram", AggExpressionNumericHistogram: value}
-}
-
-func (a *AggExpression) UnmarshalJSON(data []byte) error {
- valueAggExpressionCount := new(AggExpressionCount)
- if err := json.Unmarshal(data, &valueAggExpressionCount); err == nil {
- a.typeName = "aggExpressionCount"
- a.AggExpressionCount = valueAggExpressionCount
- return nil
- }
- valueAggExpressionSum := new(AggExpressionSum)
- if err := json.Unmarshal(data, &valueAggExpressionSum); err == nil {
- a.typeName = "aggExpressionSum"
- a.AggExpressionSum = valueAggExpressionSum
- return nil
- }
- valueAggExpressionMax := new(AggExpressionMax)
- if err := json.Unmarshal(data, &valueAggExpressionMax); err == nil {
- a.typeName = "aggExpressionMax"
- a.AggExpressionMax = valueAggExpressionMax
- return nil
- }
- valueAggExpressionMin := new(AggExpressionMin)
- if err := json.Unmarshal(data, &valueAggExpressionMin); err == nil {
- a.typeName = "aggExpressionMin"
- a.AggExpressionMin = valueAggExpressionMin
- return nil
- }
- valueAggExpressionAverage := new(AggExpressionAverage)
- if err := json.Unmarshal(data, &valueAggExpressionAverage); err == nil {
- a.typeName = "aggExpressionAverage"
- a.AggExpressionAverage = valueAggExpressionAverage
- return nil
- }
- valueAggExpressionUniqueCount := new(AggExpressionUniqueCount)
- if err := json.Unmarshal(data, &valueAggExpressionUniqueCount); err == nil {
- a.typeName = "aggExpressionUniqueCount"
- a.AggExpressionUniqueCount = valueAggExpressionUniqueCount
- return nil
- }
- valueAggExpressionDateHistogram := new(AggExpressionDateHistogram)
- if err := json.Unmarshal(data, &valueAggExpressionDateHistogram); err == nil {
- a.typeName = "aggExpressionDateHistogram"
- a.AggExpressionDateHistogram = valueAggExpressionDateHistogram
- return nil
- }
- valueAggExpressionTopValues := new(AggExpressionTopValues)
- if err := json.Unmarshal(data, &valueAggExpressionTopValues); err == nil {
- a.typeName = "aggExpressionTopValues"
- a.AggExpressionTopValues = valueAggExpressionTopValues
- return nil
- }
- valueAggExpressionNumericHistogram := new(AggExpressionNumericHistogram)
- if err := json.Unmarshal(data, &valueAggExpressionNumericHistogram); err == nil {
- a.typeName = "aggExpressionNumericHistogram"
- a.AggExpressionNumericHistogram = valueAggExpressionNumericHistogram
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, a)
-}
-
-func (a AggExpression) MarshalJSON() ([]byte, error) {
- switch a.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", a.typeName, a)
- case "aggExpressionCount":
- return json.Marshal(a.AggExpressionCount)
- case "aggExpressionSum":
- return json.Marshal(a.AggExpressionSum)
- case "aggExpressionMax":
- return json.Marshal(a.AggExpressionMax)
- case "aggExpressionMin":
- return json.Marshal(a.AggExpressionMin)
- case "aggExpressionAverage":
- return json.Marshal(a.AggExpressionAverage)
- case "aggExpressionUniqueCount":
- return json.Marshal(a.AggExpressionUniqueCount)
- case "aggExpressionDateHistogram":
- return json.Marshal(a.AggExpressionDateHistogram)
- case "aggExpressionTopValues":
- return json.Marshal(a.AggExpressionTopValues)
- case "aggExpressionNumericHistogram":
- return json.Marshal(a.AggExpressionNumericHistogram)
- }
-}
-
-type AggExpressionVisitor interface {
- VisitAggExpressionCount(*AggExpressionCount) error
- VisitAggExpressionSum(*AggExpressionSum) error
- VisitAggExpressionMax(*AggExpressionMax) error
- VisitAggExpressionMin(*AggExpressionMin) error
- VisitAggExpressionAverage(*AggExpressionAverage) error
- VisitAggExpressionUniqueCount(*AggExpressionUniqueCount) error
- VisitAggExpressionDateHistogram(*AggExpressionDateHistogram) error
- VisitAggExpressionTopValues(*AggExpressionTopValues) error
- VisitAggExpressionNumericHistogram(*AggExpressionNumericHistogram) error
-}
-
-func (a *AggExpression) Accept(v AggExpressionVisitor) error {
- switch a.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", a.typeName, a)
- case "aggExpressionCount":
- return v.VisitAggExpressionCount(a.AggExpressionCount)
- case "aggExpressionSum":
- return v.VisitAggExpressionSum(a.AggExpressionSum)
- case "aggExpressionMax":
- return v.VisitAggExpressionMax(a.AggExpressionMax)
- case "aggExpressionMin":
- return v.VisitAggExpressionMin(a.AggExpressionMin)
- case "aggExpressionAverage":
- return v.VisitAggExpressionAverage(a.AggExpressionAverage)
- case "aggExpressionUniqueCount":
- return v.VisitAggExpressionUniqueCount(a.AggExpressionUniqueCount)
- case "aggExpressionDateHistogram":
- return v.VisitAggExpressionDateHistogram(a.AggExpressionDateHistogram)
- case "aggExpressionTopValues":
- return v.VisitAggExpressionTopValues(a.AggExpressionTopValues)
- case "aggExpressionNumericHistogram":
- return v.VisitAggExpressionNumericHistogram(a.AggExpressionNumericHistogram)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_average.go b/xata/internal/fern-workspace/generated/go/agg_expression_average.go
deleted file mode 100644
index fd42880..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_average.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggExpressionAverage struct {
- Average *AverageAgg `json:"average,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_count.go b/xata/internal/fern-workspace/generated/go/agg_expression_count.go
deleted file mode 100644
index 282995c..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_count.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggExpressionCount struct {
- Count *CountAgg `json:"count,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_date_histogram.go b/xata/internal/fern-workspace/generated/go/agg_expression_date_histogram.go
deleted file mode 100644
index 0a4971a..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_date_histogram.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggExpressionDateHistogram struct {
- DateHistogram *DateHistogramAgg `json:"dateHistogram,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_map.go b/xata/internal/fern-workspace/generated/go/agg_expression_map.go
deleted file mode 100644
index 9ba14b4..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_map.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// The description of the aggregations you wish to receive.
-type AggExpressionMap = map[string]*AggExpression
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_max.go b/xata/internal/fern-workspace/generated/go/agg_expression_max.go
deleted file mode 100644
index 65c5674..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_max.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggExpressionMax struct {
- Max *MaxAgg `json:"max,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_min.go b/xata/internal/fern-workspace/generated/go/agg_expression_min.go
deleted file mode 100644
index d895daa..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_min.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggExpressionMin struct {
- Min *MinAgg `json:"min,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_numeric_histogram.go b/xata/internal/fern-workspace/generated/go/agg_expression_numeric_histogram.go
deleted file mode 100644
index 7f08431..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_numeric_histogram.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggExpressionNumericHistogram struct {
- NumericHistogram *NumericHistogramAgg `json:"numericHistogram,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_sum.go b/xata/internal/fern-workspace/generated/go/agg_expression_sum.go
deleted file mode 100644
index f78b588..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_sum.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggExpressionSum struct {
- Sum *SumAgg `json:"sum,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_top_values.go b/xata/internal/fern-workspace/generated/go/agg_expression_top_values.go
deleted file mode 100644
index 8025917..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_top_values.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggExpressionTopValues struct {
- TopValues *TopValuesAgg `json:"topValues,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_expression_unique_count.go b/xata/internal/fern-workspace/generated/go/agg_expression_unique_count.go
deleted file mode 100644
index aadefad..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_expression_unique_count.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggExpressionUniqueCount struct {
- UniqueCount *UniqueCountAgg `json:"uniqueCount,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_response.go b/xata/internal/fern-workspace/generated/go/agg_response.go
deleted file mode 100644
index 63b9579..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_response.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type AggResponse struct {
- typeName string
- DoubleOptional *float64
- AggResponseValues *AggResponseValues
-}
-
-func NewAggResponseFromDoubleOptional(value *float64) *AggResponse {
- return &AggResponse{typeName: "doubleOptional", DoubleOptional: value}
-}
-
-func NewAggResponseFromAggResponseValues(value *AggResponseValues) *AggResponse {
- return &AggResponse{typeName: "aggResponseValues", AggResponseValues: value}
-}
-
-func (a *AggResponse) UnmarshalJSON(data []byte) error {
- var valueDoubleOptional *float64
- if err := json.Unmarshal(data, &valueDoubleOptional); err == nil {
- a.typeName = "doubleOptional"
- a.DoubleOptional = valueDoubleOptional
- return nil
- }
- valueAggResponseValues := new(AggResponseValues)
- if err := json.Unmarshal(data, &valueAggResponseValues); err == nil {
- a.typeName = "aggResponseValues"
- a.AggResponseValues = valueAggResponseValues
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, a)
-}
-
-func (a AggResponse) MarshalJSON() ([]byte, error) {
- switch a.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", a.typeName, a)
- case "doubleOptional":
- return json.Marshal(a.DoubleOptional)
- case "aggResponseValues":
- return json.Marshal(a.AggResponseValues)
- }
-}
-
-type AggResponseVisitor interface {
- VisitDoubleOptional(*float64) error
- VisitAggResponseValues(*AggResponseValues) error
-}
-
-func (a *AggResponse) Accept(v AggResponseVisitor) error {
- switch a.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", a.typeName, a)
- case "doubleOptional":
- return v.VisitDoubleOptional(a.DoubleOptional)
- case "aggResponseValues":
- return v.VisitAggResponseValues(a.AggResponseValues)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_response_values.go b/xata/internal/fern-workspace/generated/go/agg_response_values.go
deleted file mode 100644
index afd0f64..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_response_values.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggResponseValues struct {
- Values []*AggResponseValuesValuesItem `json:"values,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_response_values_values_item.go b/xata/internal/fern-workspace/generated/go/agg_response_values_values_item.go
deleted file mode 100644
index b317901..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_response_values_values_item.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggResponseValuesValuesItem struct {
- Count int `json:"$count"`
- Key *AggResponseValuesValuesItemKey `json:"$key,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/agg_response_values_values_item_key.go b/xata/internal/fern-workspace/generated/go/agg_response_values_values_item_key.go
deleted file mode 100644
index 899403f..0000000
--- a/xata/internal/fern-workspace/generated/go/agg_response_values_values_item_key.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type AggResponseValuesValuesItemKey struct {
- typeName string
- String string
- Double float64
-}
-
-func NewAggResponseValuesValuesItemKeyFromString(value string) *AggResponseValuesValuesItemKey {
- return &AggResponseValuesValuesItemKey{typeName: "string", String: value}
-}
-
-func NewAggResponseValuesValuesItemKeyFromDouble(value float64) *AggResponseValuesValuesItemKey {
- return &AggResponseValuesValuesItemKey{typeName: "double", Double: value}
-}
-
-func (a *AggResponseValuesValuesItemKey) UnmarshalJSON(data []byte) error {
- var valueString string
- if err := json.Unmarshal(data, &valueString); err == nil {
- a.typeName = "string"
- a.String = valueString
- return nil
- }
- var valueDouble float64
- if err := json.Unmarshal(data, &valueDouble); err == nil {
- a.typeName = "double"
- a.Double = valueDouble
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, a)
-}
-
-func (a AggResponseValuesValuesItemKey) MarshalJSON() ([]byte, error) {
- switch a.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", a.typeName, a)
- case "string":
- return json.Marshal(a.String)
- case "double":
- return json.Marshal(a.Double)
- }
-}
-
-type AggResponseValuesValuesItemKeyVisitor interface {
- VisitString(string) error
- VisitDouble(float64) error
-}
-
-func (a *AggResponseValuesValuesItemKey) Accept(v AggResponseValuesValuesItemKeyVisitor) error {
- switch a.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", a.typeName, a)
- case "string":
- return v.VisitString(a.String)
- case "double":
- return v.VisitDouble(a.Double)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/aggregate_table_request.go b/xata/internal/fern-workspace/generated/go/aggregate_table_request.go
deleted file mode 100644
index 34f034f..0000000
--- a/xata/internal/fern-workspace/generated/go/aggregate_table_request.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// AggregateTableRequest is an in-lined request used by the AggregateTable endpoint.
-type AggregateTableRequest struct {
- Aggs *AggExpressionMap `json:"aggs,omitempty"`
- Filter *FilterExpression `json:"filter,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/aggregate_table_response.go b/xata/internal/fern-workspace/generated/go/aggregate_table_response.go
deleted file mode 100644
index c76bb90..0000000
--- a/xata/internal/fern-workspace/generated/go/aggregate_table_response.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AggregateTableResponse struct {
- Aggs *map[string]*AggResponse `json:"aggs,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/apply_branch_schema_edit_request.go b/xata/internal/fern-workspace/generated/go/apply_branch_schema_edit_request.go
deleted file mode 100644
index ebb44cd..0000000
--- a/xata/internal/fern-workspace/generated/go/apply_branch_schema_edit_request.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// ApplyBranchSchemaEditRequest is an in-lined request used by the ApplyBranchSchemaEdit endpoint.
-type ApplyBranchSchemaEditRequest struct {
- Edits *SchemaEditScript `json:"edits,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/apply_branch_schema_edit_response.go b/xata/internal/fern-workspace/generated/go/apply_branch_schema_edit_response.go
deleted file mode 100644
index 800ee08..0000000
--- a/xata/internal/fern-workspace/generated/go/apply_branch_schema_edit_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ApplyBranchSchemaEditResponse struct {
- // `non-empty`
- MigrationId string `json:"migrationID"`
- ParentMigrationId string `json:"parentMigrationID"`
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/ask_table_request.go b/xata/internal/fern-workspace/generated/go/ask_table_request.go
deleted file mode 100644
index 434c1a5..0000000
--- a/xata/internal/fern-workspace/generated/go/ask_table_request.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// AskTableRequest is an in-lined request used by the AskTable endpoint.
-type AskTableRequest struct {
- // The question you'd like to ask.
- Question string `json:"question"`
- Rules *[]string `json:"rules,omitempty"`
- Search *AskTableRequestSearch `json:"search,omitempty"`
- // The type of search to use. If set to `keyword` (the default), the search can be configured by passing
- // a `search` object with the following fields. For more details about each, see the Search endpoint documentation.
- // All fields are optional.
- // - fuzziness - typo tolerance
- // - target - columns to search into, and weights.
- // - prefix - prefix search type.
- // - filter - pre-filter before searching.
- // - boosters - control relevancy.
- //
- // If set to `vector`, a `vectorSearch` object must be passed, with the following parameters. For more details, see the Vector
- // Search endpoint documentation. The `column` and `contentColumn` parameters are required.
- // - column - the vector column containing the embeddings.
- // - contentColumn - the column that contains the text from which the embeddings where computed.
- // - filter - pre-filter before searching.
- SearchType *AskTableRequestSearchType `json:"searchType,omitempty"`
- VectorSearch *AskTableRequestVectorSearch `json:"vectorSearch,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/ask_table_request_search.go b/xata/internal/fern-workspace/generated/go/ask_table_request_search.go
deleted file mode 100644
index 8659a26..0000000
--- a/xata/internal/fern-workspace/generated/go/ask_table_request_search.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AskTableRequestSearch struct {
- Boosters *[]*BoosterExpression `json:"boosters,omitempty"`
- Filter *FilterExpression `json:"filter,omitempty"`
- Fuzziness *FuzzinessExpression `json:"fuzziness,omitempty"`
- Prefix *PrefixExpression `json:"prefix,omitempty"`
- Target *TargetExpression `json:"target,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/ask_table_request_search_type.go b/xata/internal/fern-workspace/generated/go/ask_table_request_search_type.go
deleted file mode 100644
index 2e421df..0000000
--- a/xata/internal/fern-workspace/generated/go/ask_table_request_search_type.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-// The type of search to use. If set to `keyword` (the default), the search can be configured by passing
-// a `search` object with the following fields. For more details about each, see the Search endpoint documentation.
-// All fields are optional.
-// - fuzziness - typo tolerance
-// - target - columns to search into, and weights.
-// - prefix - prefix search type.
-// - filter - pre-filter before searching.
-// - boosters - control relevancy.
-//
-// If set to `vector`, a `vectorSearch` object must be passed, with the following parameters. For more details, see the Vector
-// Search endpoint documentation. The `column` and `contentColumn` parameters are required.
-// - column - the vector column containing the embeddings.
-// - contentColumn - the column that contains the text from which the embeddings where computed.
-// - filter - pre-filter before searching.
-type AskTableRequestSearchType uint8
-
-const (
- AskTableRequestSearchTypeKeyword AskTableRequestSearchType = iota + 1
- AskTableRequestSearchTypeVector
-)
-
-func (a AskTableRequestSearchType) String() string {
- switch a {
- default:
- return strconv.Itoa(int(a))
- case AskTableRequestSearchTypeKeyword:
- return "keyword"
- case AskTableRequestSearchTypeVector:
- return "vector"
- }
-}
-
-func (a AskTableRequestSearchType) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", a.String())), nil
-}
-
-func (a *AskTableRequestSearchType) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "keyword":
- value := AskTableRequestSearchTypeKeyword
- *a = value
- case "vector":
- value := AskTableRequestSearchTypeVector
- *a = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/ask_table_request_vector_search.go b/xata/internal/fern-workspace/generated/go/ask_table_request_vector_search.go
deleted file mode 100644
index 6860b01..0000000
--- a/xata/internal/fern-workspace/generated/go/ask_table_request_vector_search.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AskTableRequestVectorSearch struct {
- // The column to use for vector search. It must be of type `vector`.
- Column string `json:"column"`
- // The column containing the text for vector search. Must be of type `text`.
- ContentColumn string `json:"contentColumn"`
- Filter *FilterExpression `json:"filter,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/ask_table_response.go b/xata/internal/fern-workspace/generated/go/ask_table_response.go
deleted file mode 100644
index 89d4627..0000000
--- a/xata/internal/fern-workspace/generated/go/ask_table_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AskTableResponse struct {
- // The answer to the input question
- Answer string `json:"answer"`
- // The session ID for the chat session.
- SessionId string `json:"sessionId"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/ask_table_session_request.go b/xata/internal/fern-workspace/generated/go/ask_table_session_request.go
deleted file mode 100644
index 78b5e3c..0000000
--- a/xata/internal/fern-workspace/generated/go/ask_table_session_request.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// AskTableSessionRequest is an in-lined request used by the AskTableSession endpoint.
-type AskTableSessionRequest struct {
- // The question you'd like to ask.
- Message *string `json:"message,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/ask_table_session_response.go b/xata/internal/fern-workspace/generated/go/ask_table_session_response.go
deleted file mode 100644
index c84c3fd..0000000
--- a/xata/internal/fern-workspace/generated/go/ask_table_session_response.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type AskTableSessionResponse struct {
- // The answer to the input question
- Answer string `json:"answer"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/average_agg.go b/xata/internal/fern-workspace/generated/go/average_agg.go
deleted file mode 100644
index 3bd8122..0000000
--- a/xata/internal/fern-workspace/generated/go/average_agg.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// The average of the numeric values in a particular column.
-type AverageAgg struct {
- // The column on which to compute the average. Must be a numeric type.
- Column string `json:"column"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/bad_request_error.go b/xata/internal/fern-workspace/generated/go/bad_request_error.go
deleted file mode 100644
index 95f9799..0000000
--- a/xata/internal/fern-workspace/generated/go/bad_request_error.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
-)
-
-type BadRequestError struct {
- *core.APIError
- Body any
-}
-
-func (b *BadRequestError) UnmarshalJSON(data []byte) error {
- var body any
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- b.StatusCode = 400
- b.Body = body
- return nil
-}
-
-func (b *BadRequestError) MarshalJSON() ([]byte, error) {
- return json.Marshal(b.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/booster_expression.go b/xata/internal/fern-workspace/generated/go/booster_expression.go
deleted file mode 100644
index f3fa9c7..0000000
--- a/xata/internal/fern-workspace/generated/go/booster_expression.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-// Booster Expression
-type BoosterExpression struct {
- typeName string
- BoosterExpressionValueBooster *BoosterExpressionValueBooster
- BoosterExpressionNumericBooster *BoosterExpressionNumericBooster
- BoosterExpressionDateBooster *BoosterExpressionDateBooster
-}
-
-func NewBoosterExpressionFromBoosterExpressionValueBooster(value *BoosterExpressionValueBooster) *BoosterExpression {
- return &BoosterExpression{typeName: "boosterExpressionValueBooster", BoosterExpressionValueBooster: value}
-}
-
-func NewBoosterExpressionFromBoosterExpressionNumericBooster(value *BoosterExpressionNumericBooster) *BoosterExpression {
- return &BoosterExpression{typeName: "boosterExpressionNumericBooster", BoosterExpressionNumericBooster: value}
-}
-
-func NewBoosterExpressionFromBoosterExpressionDateBooster(value *BoosterExpressionDateBooster) *BoosterExpression {
- return &BoosterExpression{typeName: "boosterExpressionDateBooster", BoosterExpressionDateBooster: value}
-}
-
-func (b *BoosterExpression) UnmarshalJSON(data []byte) error {
- valueBoosterExpressionValueBooster := new(BoosterExpressionValueBooster)
- if err := json.Unmarshal(data, &valueBoosterExpressionValueBooster); err == nil {
- b.typeName = "boosterExpressionValueBooster"
- b.BoosterExpressionValueBooster = valueBoosterExpressionValueBooster
- return nil
- }
- valueBoosterExpressionNumericBooster := new(BoosterExpressionNumericBooster)
- if err := json.Unmarshal(data, &valueBoosterExpressionNumericBooster); err == nil {
- b.typeName = "boosterExpressionNumericBooster"
- b.BoosterExpressionNumericBooster = valueBoosterExpressionNumericBooster
- return nil
- }
- valueBoosterExpressionDateBooster := new(BoosterExpressionDateBooster)
- if err := json.Unmarshal(data, &valueBoosterExpressionDateBooster); err == nil {
- b.typeName = "boosterExpressionDateBooster"
- b.BoosterExpressionDateBooster = valueBoosterExpressionDateBooster
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, b)
-}
-
-func (b BoosterExpression) MarshalJSON() ([]byte, error) {
- switch b.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", b.typeName, b)
- case "boosterExpressionValueBooster":
- return json.Marshal(b.BoosterExpressionValueBooster)
- case "boosterExpressionNumericBooster":
- return json.Marshal(b.BoosterExpressionNumericBooster)
- case "boosterExpressionDateBooster":
- return json.Marshal(b.BoosterExpressionDateBooster)
- }
-}
-
-type BoosterExpressionVisitor interface {
- VisitBoosterExpressionValueBooster(*BoosterExpressionValueBooster) error
- VisitBoosterExpressionNumericBooster(*BoosterExpressionNumericBooster) error
- VisitBoosterExpressionDateBooster(*BoosterExpressionDateBooster) error
-}
-
-func (b *BoosterExpression) Accept(v BoosterExpressionVisitor) error {
- switch b.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", b.typeName, b)
- case "boosterExpressionValueBooster":
- return v.VisitBoosterExpressionValueBooster(b.BoosterExpressionValueBooster)
- case "boosterExpressionNumericBooster":
- return v.VisitBoosterExpressionNumericBooster(b.BoosterExpressionNumericBooster)
- case "boosterExpressionDateBooster":
- return v.VisitBoosterExpressionDateBooster(b.BoosterExpressionDateBooster)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/booster_expression_date_booster.go b/xata/internal/fern-workspace/generated/go/booster_expression_date_booster.go
deleted file mode 100644
index c4dd382..0000000
--- a/xata/internal/fern-workspace/generated/go/booster_expression_date_booster.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type BoosterExpressionDateBooster struct {
- DateBooster *DateBooster `json:"dateBooster,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/booster_expression_numeric_booster.go b/xata/internal/fern-workspace/generated/go/booster_expression_numeric_booster.go
deleted file mode 100644
index fa3936e..0000000
--- a/xata/internal/fern-workspace/generated/go/booster_expression_numeric_booster.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type BoosterExpressionNumericBooster struct {
- NumericBooster *NumericBooster `json:"numericBooster,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/booster_expression_value_booster.go b/xata/internal/fern-workspace/generated/go/booster_expression_value_booster.go
deleted file mode 100644
index 47db243..0000000
--- a/xata/internal/fern-workspace/generated/go/booster_expression_value_booster.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type BoosterExpressionValueBooster struct {
- ValueBooster *ValueBooster `json:"valueBooster,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/branch.go b/xata/internal/fern-workspace/generated/go/branch.go
deleted file mode 100644
index 9930cd9..0000000
--- a/xata/internal/fern-workspace/generated/go/branch.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type Branch struct {
- CreatedAt DateTime `json:"createdAt"`
- Name string `json:"name"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/branch_client.go b/xata/internal/fern-workspace/generated/go/branch_client.go
deleted file mode 100644
index 3216eac..0000000
--- a/xata/internal/fern-workspace/generated/go/branch_client.go
+++ /dev/null
@@ -1,777 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- bytes "bytes"
- context "context"
- json "encoding/json"
- errors "errors"
- fmt "fmt"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
- io "io"
- http "net/http"
- url "net/url"
-)
-
-type BranchClient interface {
- GetBranchDetails(ctx context.Context, dbBranchName DbBranchName) (*DbBranch, error)
- CreateBranch(ctx context.Context, dbBranchName DbBranchName, request *CreateBranchRequest) (*CreateBranchResponse, error)
- DeleteBranch(ctx context.Context, dbBranchName DbBranchName) (*DeleteBranchResponse, error)
- GetBranchMetadata(ctx context.Context, dbBranchName DbBranchName) (*BranchMetadata, error)
- UpdateBranchMetadata(ctx context.Context, dbBranchName DbBranchName, request *BranchMetadata) error
- GetBranchStats(ctx context.Context, dbBranchName DbBranchName) (*GetBranchStatsResponse, error)
- GetBranchList(ctx context.Context, dbName DbName) (*ListBranchesResponse, error)
- GetGitBranchesMapping(ctx context.Context, dbName DbName) (*ListGitBranchesResponse, error)
- AddGitBranchesEntry(ctx context.Context, dbName DbName, request *AddGitBranchesEntryRequest) (*AddGitBranchesEntryResponse, error)
- RemoveGitBranchesEntry(ctx context.Context, dbName DbName, request *RemoveGitBranchesEntryRequest) error
- ResolveBranch(ctx context.Context, dbName DbName, request *ResolveBranchRequest) (*ResolveBranchResponse, error)
-}
-
-func NewBranchClient(opts ...core.ClientOption) BranchClient {
- options := core.NewClientOptions()
- for _, opt := range opts {
- opt(options)
- }
- return &branchClient{
- baseURL: options.BaseURL,
- httpClient: options.HTTPClient,
- header: options.ToHeader(),
- }
-}
-
-type branchClient struct {
- baseURL string
- httpClient core.HTTPClient
- header http.Header
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (b *branchClient) GetBranchDetails(ctx context.Context, dbBranchName DbBranchName) (*DbBranch, error) {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *DbBranch
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- &response,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (b *branchClient) CreateBranch(ctx context.Context, dbBranchName DbBranchName, request *CreateBranchRequest) (*CreateBranchResponse, error) {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v", dbBranchName)
-
- queryParams := make(url.Values)
- if request.From != nil {
- queryParams.Add("from", fmt.Sprintf("%v", *request.From))
- }
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *CreateBranchResponse
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodPut,
- request,
- &response,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Delete the branch in the database and all its resources
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (b *branchClient) DeleteBranch(ctx context.Context, dbBranchName DbBranchName) (*DeleteBranchResponse, error) {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 409:
- value := new(ConflictError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *DeleteBranchResponse
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodDelete,
- nil,
- &response,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (b *branchClient) GetBranchMetadata(ctx context.Context, dbBranchName DbBranchName) (*BranchMetadata, error) {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/metadata", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *BranchMetadata
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- &response,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Update the branch metadata
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (b *branchClient) UpdateBranchMetadata(ctx context.Context, dbBranchName DbBranchName, request *BranchMetadata) error {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/metadata", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodPut,
- request,
- nil,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return err
- }
- return nil
-}
-
-// Get branch usage metrics.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (b *branchClient) GetBranchStats(ctx context.Context, dbBranchName DbBranchName) (*GetBranchStatsResponse, error) {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/stats", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *GetBranchStatsResponse
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- &response,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// List all available Branches
-//
-// The Database Name
-func (b *branchClient) GetBranchList(ctx context.Context, dbName DbName) (*ListBranchesResponse, error) {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"dbs/%v", dbName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *ListBranchesResponse
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- &response,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Lists all the git branches in the mapping, and their associated Xata branches.
-//
-// Example response:
-//
-// ```json
-//
-// {
-// "mappings": [
-// {
-// "gitBranch": "main",
-// "xataBranch": "main"
-// },
-// {
-// "gitBranch": "gitBranch1",
-// "xataBranch": "xataBranch1"
-// }
-// {
-// "gitBranch": "xataBranch2",
-// "xataBranch": "xataBranch2"
-// }
-// ]
-// }
-//
-// ```
-//
-// The Database Name
-func (b *branchClient) GetGitBranchesMapping(ctx context.Context, dbName DbName) (*ListGitBranchesResponse, error) {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"dbs/%v/gitBranches", dbName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *ListGitBranchesResponse
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- &response,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Adds an entry to the mapping of git branches to Xata branches. The git branch and the Xata branch must be present in the body of the request. If the Xata branch doesn't exist, a 400 error is returned.
-//
-// If the git branch is already present in the mapping, the old entry is overwritten, and a warning message is included in the response. If the git branch is added and didn't exist before, the response code is 204. If the git branch existed and it was overwritten, the response code is 201.
-//
-// Example request:
-//
-// ```json
-// // POST https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches
-//
-// {
-// "gitBranch": "fix/bug123",
-// "xataBranch": "fix_bug"
-// }
-//
-// ```
-//
-// The Database Name
-func (b *branchClient) AddGitBranchesEntry(ctx context.Context, dbName DbName, request *AddGitBranchesEntryRequest) (*AddGitBranchesEntryResponse, error) {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"dbs/%v/gitBranches", dbName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *AddGitBranchesEntryResponse
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Removes an entry from the mapping of git branches to Xata branches. The name of the git branch must be passed as a query parameter. If the git branch is not found, the endpoint returns a 404 status code.
-//
-// Example request:
-//
-// ```json
-// // DELETE https://tutorial-ng7s8c.xata.sh/dbs/demo/gitBranches?gitBranch=fix%2Fbug123
-// ```
-//
-// The Database Name
-func (b *branchClient) RemoveGitBranchesEntry(ctx context.Context, dbName DbName, request *RemoveGitBranchesEntryRequest) error {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"dbs/%v/gitBranches", dbName)
-
- queryParams := make(url.Values)
- queryParams.Add("gitBranch", fmt.Sprintf("%v", request.GitBranch))
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodDelete,
- request,
- nil,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return err
- }
- return nil
-}
-
-// In order to resolve the database branch, the following algorithm is used:
-// * if the `gitBranch` was provided and is found in the [git branches mapping](/api-reference/dbs/db_name/gitBranches), the associated Xata branch is returned
-// * else, if a Xata branch with the exact same name as `gitBranch` exists, return it
-// * else, if `fallbackBranch` is provided and a branch with that name exists, return it
-// * else, return the default branch of the DB (`main` or the first branch)
-//
-// Example call:
-//
-// ```json
-// // GET https://tutorial-ng7s8c.xata.sh/dbs/demo/dbs/demo/resolveBranch?gitBranch=test&fallbackBranch=tsg
-// ```
-//
-// Example response:
-//
-// ```json
-//
-// {
-// "branch": "main",
-// "reason": {
-// "code": "DEFAULT_BRANCH",
-// "message": "Default branch for this database (main)"
-// }
-// }
-//
-// ```
-//
-// The Database Name
-func (b *branchClient) ResolveBranch(ctx context.Context, dbName DbName, request *ResolveBranchRequest) (*ResolveBranchResponse, error) {
- baseURL := "/"
- if b.baseURL != "" {
- baseURL = b.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"dbs/%v/resolveBranch", dbName)
-
- queryParams := make(url.Values)
- if request.GitBranch != nil {
- queryParams.Add("gitBranch", fmt.Sprintf("%v", *request.GitBranch))
- }
- if request.FallbackBranch != nil {
- queryParams.Add("fallbackBranch", fmt.Sprintf("%v", *request.FallbackBranch))
- }
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *ResolveBranchResponse
- if err := core.DoRequest(
- ctx,
- b.httpClient,
- endpointURL,
- http.MethodGet,
- request,
- &response,
- false,
- b.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/branch_metadata.go b/xata/internal/fern-workspace/generated/go/branch_metadata.go
deleted file mode 100644
index 01b750d..0000000
--- a/xata/internal/fern-workspace/generated/go/branch_metadata.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type BranchMetadata struct {
- Branch *BranchName `json:"branch,omitempty"`
- Labels *[]string `json:"labels,omitempty"`
- // `non-empty`
- Repository *string `json:"repository,omitempty"`
- // `non-empty`
- Stage *string `json:"stage,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/branch_migration.go b/xata/internal/fern-workspace/generated/go/branch_migration.go
deleted file mode 100644
index b3457fe..0000000
--- a/xata/internal/fern-workspace/generated/go/branch_migration.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type BranchMigration struct {
- CreatedAt *DateTime `json:"createdAt,omitempty"`
- Id *string `json:"id,omitempty"`
- LastGitRevision *string `json:"lastGitRevision,omitempty"`
- LocalChanges bool `json:"localChanges"`
- NewTableOrder []string `json:"newTableOrder,omitempty"`
- NewTables *map[string]*Table `json:"newTables,omitempty"`
- ParentId *string `json:"parentID,omitempty"`
- RemovedTables *[]string `json:"removedTables,omitempty"`
- RenamedTables *[]*TableRename `json:"renamedTables,omitempty"`
- Status string `json:"status"`
- TableMigrations *map[string]*TableMigration `json:"tableMigrations,omitempty"`
- Title *string `json:"title,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/branch_name.go b/xata/internal/fern-workspace/generated/go/branch_name.go
deleted file mode 100644
index 5866fb7..0000000
--- a/xata/internal/fern-workspace/generated/go/branch_name.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// `non-empty` `<= 255 characters`
-type BranchName = string
diff --git a/xata/internal/fern-workspace/generated/go/branch_op.go b/xata/internal/fern-workspace/generated/go/branch_op.go
deleted file mode 100644
index 4b3a943..0000000
--- a/xata/internal/fern-workspace/generated/go/branch_op.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type BranchOp struct {
- CreatedAt DateTime `json:"createdAt"`
- Id string `json:"id"`
- Message *string `json:"message,omitempty"`
- Migration *Commit `json:"migration,omitempty"`
- ModifiedAt *DateTime `json:"modifiedAt,omitempty"`
- ParentId *string `json:"parentID,omitempty"`
- Status MigrationStatus `json:"status,omitempty"`
- Title *string `json:"title,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/branch_transaction_request.go b/xata/internal/fern-workspace/generated/go/branch_transaction_request.go
deleted file mode 100644
index fcc82c6..0000000
--- a/xata/internal/fern-workspace/generated/go/branch_transaction_request.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// BranchTransactionRequest is an in-lined request used by the BranchTransaction endpoint.
-type BranchTransactionRequest struct {
- Operations []*TransactionOperation `json:"operations,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/branch_with_copy_id.go b/xata/internal/fern-workspace/generated/go/branch_with_copy_id.go
deleted file mode 100644
index 73d8301..0000000
--- a/xata/internal/fern-workspace/generated/go/branch_with_copy_id.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type BranchWithCopyId struct {
- BranchName BranchName `json:"branchName"`
- CopyId string `json:"copyID"`
- DbBranchId string `json:"dbBranchID"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_request.go b/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_request.go
deleted file mode 100644
index 1c2caf2..0000000
--- a/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_request.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// BulkInsertTableRecordsRequest is an in-lined request used by the BulkInsertTableRecords endpoint.
-type BulkInsertTableRecordsRequest struct {
- // Column filters
- Columns []*string `json:"-"`
- Records []DataInputRecord `json:"records,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_response.go b/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_response.go
deleted file mode 100644
index 2a41e32..0000000
--- a/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_response.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type BulkInsertTableRecordsResponse struct {
- typeName string
- BulkInsertTableRecordsResponseRecordIDs *BulkInsertTableRecordsResponseRecordIDs
- BulkInsertTableRecordsResponseRecords *BulkInsertTableRecordsResponseRecords
-}
-
-func NewBulkInsertTableRecordsResponseFromBulkInsertTableRecordsResponseRecordIDs(value *BulkInsertTableRecordsResponseRecordIDs) *BulkInsertTableRecordsResponse {
- return &BulkInsertTableRecordsResponse{typeName: "bulkInsertTableRecordsResponseRecordIDs", BulkInsertTableRecordsResponseRecordIDs: value}
-}
-
-func NewBulkInsertTableRecordsResponseFromBulkInsertTableRecordsResponseRecords(value *BulkInsertTableRecordsResponseRecords) *BulkInsertTableRecordsResponse {
- return &BulkInsertTableRecordsResponse{typeName: "bulkInsertTableRecordsResponseRecords", BulkInsertTableRecordsResponseRecords: value}
-}
-
-func (b *BulkInsertTableRecordsResponse) UnmarshalJSON(data []byte) error {
- valueBulkInsertTableRecordsResponseRecordIDs := new(BulkInsertTableRecordsResponseRecordIDs)
- if err := json.Unmarshal(data, &valueBulkInsertTableRecordsResponseRecordIDs); err == nil {
- b.typeName = "bulkInsertTableRecordsResponseRecordIDs"
- b.BulkInsertTableRecordsResponseRecordIDs = valueBulkInsertTableRecordsResponseRecordIDs
- return nil
- }
- valueBulkInsertTableRecordsResponseRecords := new(BulkInsertTableRecordsResponseRecords)
- if err := json.Unmarshal(data, &valueBulkInsertTableRecordsResponseRecords); err == nil {
- b.typeName = "bulkInsertTableRecordsResponseRecords"
- b.BulkInsertTableRecordsResponseRecords = valueBulkInsertTableRecordsResponseRecords
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, b)
-}
-
-func (b BulkInsertTableRecordsResponse) MarshalJSON() ([]byte, error) {
- switch b.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", b.typeName, b)
- case "bulkInsertTableRecordsResponseRecordIDs":
- return json.Marshal(b.BulkInsertTableRecordsResponseRecordIDs)
- case "bulkInsertTableRecordsResponseRecords":
- return json.Marshal(b.BulkInsertTableRecordsResponseRecords)
- }
-}
-
-type BulkInsertTableRecordsResponseVisitor interface {
- VisitBulkInsertTableRecordsResponseRecordIDs(*BulkInsertTableRecordsResponseRecordIDs) error
- VisitBulkInsertTableRecordsResponseRecords(*BulkInsertTableRecordsResponseRecords) error
-}
-
-func (b *BulkInsertTableRecordsResponse) Accept(v BulkInsertTableRecordsResponseVisitor) error {
- switch b.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", b.typeName, b)
- case "bulkInsertTableRecordsResponseRecordIDs":
- return v.VisitBulkInsertTableRecordsResponseRecordIDs(b.BulkInsertTableRecordsResponseRecordIDs)
- case "bulkInsertTableRecordsResponseRecords":
- return v.VisitBulkInsertTableRecordsResponseRecords(b.BulkInsertTableRecordsResponseRecords)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_response_record_i_ds.go b/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_response_record_i_ds.go
deleted file mode 100644
index 11200dc..0000000
--- a/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_response_record_i_ds.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type BulkInsertTableRecordsResponseRecordIDs struct {
- RecordIDs []string `json:"recordIDs,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_response_records.go b/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_response_records.go
deleted file mode 100644
index f866fac..0000000
--- a/xata/internal/fern-workspace/generated/go/bulk_insert_table_records_response_records.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type BulkInsertTableRecordsResponseRecords struct {
- Records []*Record `json:"records,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/client.go b/xata/internal/fern-workspace/generated/go/client.go
deleted file mode 100644
index 6ab79b2..0000000
--- a/xata/internal/fern-workspace/generated/go/client.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
- http "net/http"
-)
-
-type Client interface {
- Branch() BranchClient
- Migrations() MigrationsClient
- SearchAndFilter() SearchAndFilterClient
- Table() TableClient
- Records() RecordsClient
- Files() FilesClient
-}
-
-func NewClient(opts ...core.ClientOption) Client {
- options := core.NewClientOptions()
- for _, opt := range opts {
- opt(options)
- }
- return &client{
- baseURL: options.BaseURL,
- httpClient: options.HTTPClient,
- header: options.ToHeader(),
- branchClient: NewBranchClient(opts...),
- migrationsClient: NewMigrationsClient(opts...),
- searchAndFilterClient: NewSearchAndFilterClient(opts...),
- tableClient: NewTableClient(opts...),
- recordsClient: NewRecordsClient(opts...),
- filesClient: NewFilesClient(opts...),
- }
-}
-
-type client struct {
- baseURL string
- httpClient core.HTTPClient
- header http.Header
- branchClient BranchClient
- migrationsClient MigrationsClient
- searchAndFilterClient SearchAndFilterClient
- tableClient TableClient
- recordsClient RecordsClient
- filesClient FilesClient
-}
-
-func (c *client) Branch() BranchClient {
- return c.branchClient
-}
-
-func (c *client) Migrations() MigrationsClient {
- return c.migrationsClient
-}
-
-func (c *client) SearchAndFilter() SearchAndFilterClient {
- return c.searchAndFilterClient
-}
-
-func (c *client) Table() TableClient {
- return c.tableClient
-}
-
-func (c *client) Records() RecordsClient {
- return c.recordsClient
-}
-
-func (c *client) Files() FilesClient {
- return c.filesClient
-}
diff --git a/xata/internal/fern-workspace/generated/go/client_options.go b/xata/internal/fern-workspace/generated/go/client_options.go
deleted file mode 100644
index d4d1764..0000000
--- a/xata/internal/fern-workspace/generated/go/client_options.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
- http "net/http"
-)
-
-// ClientWithBaseURL sets the client's base URL, overriding the
-// default environment, if any.
-func ClientWithBaseURL(baseURL string) core.ClientOption {
- return func(opts *core.ClientOptions) {
- opts.BaseURL = baseURL
- }
-}
-
-// ClientWithHTTPClient uses the given HTTPClient to issue all HTTP requests.
-func ClientWithHTTPClient(httpClient core.HTTPClient) core.ClientOption {
- return func(opts *core.ClientOptions) {
- opts.HTTPClient = httpClient
- }
-}
-
-// ClientWithHTTPHeader adds the given http.Header to all requests
-// issued by the client. The given headers are added to the final set
-// after the standard headers (e.g. Content-Type), but before the
-// endpoint-specific headers.
-func ClientWithHTTPHeader(httpHeader http.Header) core.ClientOption {
- return func(opts *core.ClientOptions) {
- // Clone the headers so they can't be modified after the option call.
- opts.HTTPHeader = httpHeader.Clone()
- }
-}
-
-// ClientWithAuthBearer sets the 'Authorization: Bearer ' header on every request.
-func ClientWithAuthBearer(bearer string) core.ClientOption {
- return func(opts *core.ClientOptions) {
- opts.Bearer = bearer
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/column.go b/xata/internal/fern-workspace/generated/go/column.go
deleted file mode 100644
index e74cdfb..0000000
--- a/xata/internal/fern-workspace/generated/go/column.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type Column struct {
- Columns *[]*Column `json:"columns,omitempty"`
- DefaultValue *string `json:"defaultValue,omitempty"`
- File *ColumnFile `json:"file,omitempty"`
- File *ColumnFile `json:"file[],omitempty"`
- Link *ColumnLink `json:"link,omitempty"`
- Name string `json:"name"`
- NotNull *bool `json:"notNull,omitempty"`
- Type ColumnType `json:"type,omitempty"`
- Unique *bool `json:"unique,omitempty"`
- Vector *ColumnVector `json:"vector,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/column_file.go b/xata/internal/fern-workspace/generated/go/column_file.go
deleted file mode 100644
index ae8e5a3..0000000
--- a/xata/internal/fern-workspace/generated/go/column_file.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ColumnFile struct {
- DefaultPublicAccess *bool `json:"defaultPublicAccess,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/column_link.go b/xata/internal/fern-workspace/generated/go/column_link.go
deleted file mode 100644
index 9a511d1..0000000
--- a/xata/internal/fern-workspace/generated/go/column_link.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ColumnLink struct {
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/column_migration.go b/xata/internal/fern-workspace/generated/go/column_migration.go
deleted file mode 100644
index 4eec771..0000000
--- a/xata/internal/fern-workspace/generated/go/column_migration.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ColumnMigration struct {
- New *Column `json:"new,omitempty"`
- Old *Column `json:"old,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/column_name.go b/xata/internal/fern-workspace/generated/go/column_name.go
deleted file mode 100644
index e4ebf6a..0000000
--- a/xata/internal/fern-workspace/generated/go/column_name.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ColumnName = string
diff --git a/xata/internal/fern-workspace/generated/go/column_op_add.go b/xata/internal/fern-workspace/generated/go/column_op_add.go
deleted file mode 100644
index e5adad3..0000000
--- a/xata/internal/fern-workspace/generated/go/column_op_add.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ColumnOpAdd struct {
- Column *Column `json:"column,omitempty"`
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/column_op_remove.go b/xata/internal/fern-workspace/generated/go/column_op_remove.go
deleted file mode 100644
index 303bcd0..0000000
--- a/xata/internal/fern-workspace/generated/go/column_op_remove.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ColumnOpRemove struct {
- Column string `json:"column"`
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/column_op_rename.go b/xata/internal/fern-workspace/generated/go/column_op_rename.go
deleted file mode 100644
index d6c2028..0000000
--- a/xata/internal/fern-workspace/generated/go/column_op_rename.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ColumnOpRename struct {
- NewName string `json:"newName"`
- OldName string `json:"oldName"`
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/column_type.go b/xata/internal/fern-workspace/generated/go/column_type.go
deleted file mode 100644
index 79c4d11..0000000
--- a/xata/internal/fern-workspace/generated/go/column_type.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-type ColumnType uint8
-
-const (
- ColumnTypeBool ColumnType = iota + 1
- ColumnTypeInt
- ColumnTypeFloat
- ColumnTypeString
- ColumnTypeText
- ColumnTypeEmail
- ColumnTypeMultiple
- ColumnTypeLink
- ColumnTypeObject
- ColumnTypeDatetime
- ColumnTypeVector
- ColumnTypeFileArray
- ColumnTypeFile
- ColumnTypeJson
-)
-
-func (c ColumnType) String() string {
- switch c {
- default:
- return strconv.Itoa(int(c))
- case ColumnTypeBool:
- return "bool"
- case ColumnTypeInt:
- return "int"
- case ColumnTypeFloat:
- return "float"
- case ColumnTypeString:
- return "string"
- case ColumnTypeText:
- return "text"
- case ColumnTypeEmail:
- return "email"
- case ColumnTypeMultiple:
- return "multiple"
- case ColumnTypeLink:
- return "link"
- case ColumnTypeObject:
- return "object"
- case ColumnTypeDatetime:
- return "datetime"
- case ColumnTypeVector:
- return "vector"
- case ColumnTypeFileArray:
- return "fileArray"
- case ColumnTypeFile:
- return "file"
- case ColumnTypeJson:
- return "json"
- }
-}
-
-func (c ColumnType) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", c.String())), nil
-}
-
-func (c *ColumnType) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "bool":
- value := ColumnTypeBool
- *c = value
- case "int":
- value := ColumnTypeInt
- *c = value
- case "float":
- value := ColumnTypeFloat
- *c = value
- case "string":
- value := ColumnTypeString
- *c = value
- case "text":
- value := ColumnTypeText
- *c = value
- case "email":
- value := ColumnTypeEmail
- *c = value
- case "multiple":
- value := ColumnTypeMultiple
- *c = value
- case "link":
- value := ColumnTypeLink
- *c = value
- case "object":
- value := ColumnTypeObject
- *c = value
- case "datetime":
- value := ColumnTypeDatetime
- *c = value
- case "vector":
- value := ColumnTypeVector
- *c = value
- case "fileArray":
- value := ColumnTypeFileArray
- *c = value
- case "file":
- value := ColumnTypeFile
- *c = value
- case "json":
- value := ColumnTypeJson
- *c = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/column_vector.go b/xata/internal/fern-workspace/generated/go/column_vector.go
deleted file mode 100644
index 31806e7..0000000
--- a/xata/internal/fern-workspace/generated/go/column_vector.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ColumnVector struct {
- Dimension int `json:"dimension"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/columns_projection.go b/xata/internal/fern-workspace/generated/go/columns_projection.go
deleted file mode 100644
index d72d608..0000000
--- a/xata/internal/fern-workspace/generated/go/columns_projection.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ColumnsProjection = []string
diff --git a/xata/internal/fern-workspace/generated/go/commit.go b/xata/internal/fern-workspace/generated/go/commit.go
deleted file mode 100644
index a47d5cd..0000000
--- a/xata/internal/fern-workspace/generated/go/commit.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type Commit struct {
- Checksum string `json:"checksum"`
- CreatedAt DateTime `json:"createdAt"`
- Id string `json:"id"`
- MergeParentId *string `json:"mergeParentID,omitempty"`
- Message *string `json:"message,omitempty"`
- Operations []*MigrationOp `json:"operations,omitempty"`
- ParentId *string `json:"parentID,omitempty"`
- Title *string `json:"title,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/compare_branch_schemas_request.go b/xata/internal/fern-workspace/generated/go/compare_branch_schemas_request.go
deleted file mode 100644
index 7add64d..0000000
--- a/xata/internal/fern-workspace/generated/go/compare_branch_schemas_request.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// CompareBranchSchemasRequest is an in-lined request used by the CompareBranchSchemas endpoint.
-type CompareBranchSchemasRequest struct {
- SourceBranchOperations *[]*MigrationOp `json:"sourceBranchOperations,omitempty"`
- TargetBranchOperations *[]*MigrationOp `json:"targetBranchOperations,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/compare_branch_schemas_response.go b/xata/internal/fern-workspace/generated/go/compare_branch_schemas_response.go
deleted file mode 100644
index 8841134..0000000
--- a/xata/internal/fern-workspace/generated/go/compare_branch_schemas_response.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type CompareBranchSchemasResponse struct {
- Edits *SchemaEditScript `json:"edits,omitempty"`
- Source *Schema `json:"source,omitempty"`
- Target *Schema `json:"target,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/compare_branch_with_user_schema_request.go b/xata/internal/fern-workspace/generated/go/compare_branch_with_user_schema_request.go
deleted file mode 100644
index 659c50d..0000000
--- a/xata/internal/fern-workspace/generated/go/compare_branch_with_user_schema_request.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// CompareBranchWithUserSchemaRequest is an in-lined request used by the CompareBranchWithUserSchema endpoint.
-type CompareBranchWithUserSchemaRequest struct {
- BranchOperations *[]*MigrationOp `json:"branchOperations,omitempty"`
- Schema *Schema `json:"schema,omitempty"`
- SchemaOperations *[]*MigrationOp `json:"schemaOperations,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/compare_branch_with_user_schema_response.go b/xata/internal/fern-workspace/generated/go/compare_branch_with_user_schema_response.go
deleted file mode 100644
index c7b98e0..0000000
--- a/xata/internal/fern-workspace/generated/go/compare_branch_with_user_schema_response.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type CompareBranchWithUserSchemaResponse struct {
- Edits *SchemaEditScript `json:"edits,omitempty"`
- Source *Schema `json:"source,omitempty"`
- Target *Schema `json:"target,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/conflict_error.go b/xata/internal/fern-workspace/generated/go/conflict_error.go
deleted file mode 100644
index 029b69f..0000000
--- a/xata/internal/fern-workspace/generated/go/conflict_error.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
-)
-
-type ConflictError struct {
- *core.APIError
- Body any
-}
-
-func (c *ConflictError) UnmarshalJSON(data []byte) error {
- var body any
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- c.StatusCode = 409
- c.Body = body
- return nil
-}
-
-func (c *ConflictError) MarshalJSON() ([]byte, error) {
- return json.Marshal(c.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/core/client_option.go b/xata/internal/fern-workspace/generated/go/core/client_option.go
deleted file mode 100644
index 485cf93..0000000
--- a/xata/internal/fern-workspace/generated/go/core/client_option.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package core
-
-import (
- http "net/http"
-)
-
-// ClientOption adapts the behavior of the generated client.
-type ClientOption func(*ClientOptions)
-
-// ClientOptions defines all of the possible client options.
-// This type is primarily used by the generated code and is
-// not meant to be used directly; use ClientOption instead.
-type ClientOptions struct {
- BaseURL string
- HTTPClient HTTPClient
- HTTPHeader http.Header
- Bearer string
-}
-
-// NewClientOptions returns a new *ClientOptions value.
-// This function is primarily used by the generated code and is
-// not meant to be used directly; use ClientOption instead.
-func NewClientOptions() *ClientOptions {
- return &ClientOptions{
- HTTPClient: http.DefaultClient,
- HTTPHeader: make(http.Header),
- }
-}
-
-// ToHeader maps the configured client options into a http.Header issued
-// on every request.
-func (c *ClientOptions) ToHeader() http.Header {
- header := c.HTTPHeader.Clone()
- if c.Bearer != "" {
- header.Set("Authorization", "Bearer "+c.Bearer)
- }
- return header
-}
diff --git a/xata/internal/fern-workspace/generated/go/core/core.go b/xata/internal/fern-workspace/generated/go/core/core.go
deleted file mode 100644
index 6f7e370..0000000
--- a/xata/internal/fern-workspace/generated/go/core/core.go
+++ /dev/null
@@ -1,198 +0,0 @@
-package core
-
-import (
- "bytes"
- "context"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "net/http"
-)
-
-const (
- // contentType specifies the JSON Content-Type header value.
- contentType = "application/json"
- contentTypeHeader = "Content-Type"
-
- // fernLanguage specifies the value of the X-Fern-Language header.
- fernLanguage = "go"
- fernLanguageHeader = "X-Fern-Language"
-
- // fernSDKName specifies the name of this Fern SDK.
- fernSDKName = "fern-go-sdk"
- fernSDKNameHeader = "X-Fern-SDK-Name"
-
- // fernSDKVersion specifies the version of this Fern SDK.
- fernSDKVersion = "0.0.1"
- fernSDKVersionHeader = "X-Fern-SDK-Version"
-)
-
-// fernHeaders specifies all of the standard Fern headers in
-// a set so that they're easier to access and reference.
-var fernHeaders = map[string]string{
- contentTypeHeader: contentType,
- fernLanguageHeader: fernLanguage,
- fernSDKNameHeader: fernSDKName,
- fernSDKVersionHeader: fernSDKVersion,
-}
-
-// HTTPClient is an interface for a subset of the *http.Client.
-type HTTPClient interface {
- Do(*http.Request) (*http.Response, error)
-}
-
-// APIError is a lightweight wrapper around the standard error
-// interface that preserves the status code from the RPC, if any.
-type APIError struct {
- err error
-
- StatusCode int `json:"-"`
-}
-
-// NewAPIError constructs a new API error.
-func NewAPIError(statusCode int, err error) *APIError {
- return &APIError{
- err: err,
- StatusCode: statusCode,
- }
-}
-
-// Unwrap returns the underlying error. This also makes the error compatible
-// with errors.As and errors.Is.
-func (a *APIError) Unwrap() error {
- if a == nil {
- return nil
- }
- return a.err
-}
-
-// Error returns the API error's message.
-func (a *APIError) Error() string {
- if a == nil || (a.err == nil && a.StatusCode == 0) {
- return ""
- }
- if a.err == nil {
- return fmt.Sprintf("%d", a.StatusCode)
- }
- if a.StatusCode == 0 {
- return a.err.Error()
- }
- return fmt.Sprintf("%d: %s", a.StatusCode, a.err.Error())
-}
-
-// DoRequest issues a JSON request to the given url.
-func DoRequest(
- ctx context.Context,
- client HTTPClient,
- url string,
- method string,
- request any,
- response any,
- responseIsOptional bool,
- endpointHeaders http.Header,
- errorDecoder func(int, io.Reader) error,
-) error {
- var requestBody io.Reader
- if request != nil {
- if body, ok := request.(io.Reader); ok {
- requestBody = body
- } else {
- requestBytes, err := json.Marshal(request)
- if err != nil {
- return err
- }
- requestBody = bytes.NewReader(requestBytes)
- }
- }
- req, err := newRequest(ctx, url, method, endpointHeaders, requestBody)
- if err != nil {
- return err
- }
-
- // If the call has been cancelled, don't issue the request.
- if err := ctx.Err(); err != nil {
- return err
- }
- resp, err := client.Do(req)
- if err != nil {
- return err
- }
-
- // Close the response body after we're done.
- defer resp.Body.Close()
-
- // Check if the call was cancelled before we return the error
- // associated with the call and/or unmarshal the response data.
- if err := ctx.Err(); err != nil {
- return err
- }
-
- if resp.StatusCode < 200 || resp.StatusCode >= 300 {
- if errorDecoder != nil {
- // This endpoint has custom errors, so we'll
- // attempt to unmarshal the error into a structured
- // type based on the status code.
- return errorDecoder(resp.StatusCode, resp.Body)
- }
- // This endpoint doesn't have any custom error
- // types, so we just read the body as-is, and
- // put it into a normal error.
- bytes, err := io.ReadAll(resp.Body)
- if err != nil && err != io.EOF {
- return err
- }
- if err == io.EOF {
- // The error didn't have a response body,
- // so all we can do is return an error
- // with the status code.
- return NewAPIError(resp.StatusCode, nil)
- }
- return NewAPIError(resp.StatusCode, errors.New(string(bytes)))
- }
-
- // Mutate the response parameter in-place.
- if response != nil {
- if writer, ok := response.(io.Writer); ok {
- _, err = io.Copy(writer, resp.Body)
- } else {
- err = json.NewDecoder(resp.Body).Decode(response)
- }
- if err != nil {
- if err == io.EOF {
- if responseIsOptional {
- // The response is optional, so we should ignore the
- // io.EOF error
- return nil
- }
- return fmt.Errorf("expected a %T response, but the server responded with nothing", response)
- }
- return err
- }
- }
-
- return nil
-}
-
-// newRequest returns a new *http.Request with all of the fields
-// required to issue the call.
-func newRequest(
- ctx context.Context,
- url string,
- method string,
- endpointHeaders http.Header,
- requestBody io.Reader,
-) (*http.Request, error) {
- req, err := http.NewRequestWithContext(ctx, method, url, requestBody)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- for name, value := range fernHeaders {
- req.Header.Set(name, value)
- }
- for name, values := range endpointHeaders {
- req.Header[name] = values
- }
- return req, nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/count_agg.go b/xata/internal/fern-workspace/generated/go/count_agg.go
deleted file mode 100644
index fd956c3..0000000
--- a/xata/internal/fern-workspace/generated/go/count_agg.go
+++ /dev/null
@@ -1,72 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-// Count the number of records with an optional filter.
-type CountAgg struct {
- typeName string
- CountAggFilter *CountAggFilter
- stringLiteral string
-}
-
-func NewCountAggFromCountAggFilter(value *CountAggFilter) *CountAgg {
- return &CountAgg{typeName: "countAggFilter", CountAggFilter: value}
-}
-
-func NewCountAggWithStringLiteral() *CountAgg {
- return &CountAgg{typeName: "stringLiteral", stringLiteral: "*"}
-}
-
-func (c *CountAgg) StringLiteral() string {
- return c.stringLiteral
-}
-
-func (c *CountAgg) UnmarshalJSON(data []byte) error {
- valueCountAggFilter := new(CountAggFilter)
- if err := json.Unmarshal(data, &valueCountAggFilter); err == nil {
- c.typeName = "countAggFilter"
- c.CountAggFilter = valueCountAggFilter
- return nil
- }
- var valueStringLiteral string
- if err := json.Unmarshal(data, &valueStringLiteral); err == nil {
- if valueStringLiteral == "*" {
- c.typeName = "stringLiteral"
- c.stringLiteral = valueStringLiteral
- return nil
- }
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, c)
-}
-
-func (c CountAgg) MarshalJSON() ([]byte, error) {
- switch c.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", c.typeName, c)
- case "countAggFilter":
- return json.Marshal(c.CountAggFilter)
- case "stringLiteral":
- return json.Marshal("*")
- }
-}
-
-type CountAggVisitor interface {
- VisitCountAggFilter(*CountAggFilter) error
- VisitStringLiteral(string) error
-}
-
-func (c *CountAgg) Accept(v CountAggVisitor) error {
- switch c.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", c.typeName, c)
- case "countAggFilter":
- return v.VisitCountAggFilter(c.CountAggFilter)
- case "stringLiteral":
- return v.VisitStringLiteral(c.stringLiteral)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/count_agg_filter.go b/xata/internal/fern-workspace/generated/go/count_agg_filter.go
deleted file mode 100644
index b0be00b..0000000
--- a/xata/internal/fern-workspace/generated/go/count_agg_filter.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type CountAggFilter struct {
- Filter *FilterExpression `json:"filter,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/create_branch_request.go b/xata/internal/fern-workspace/generated/go/create_branch_request.go
deleted file mode 100644
index 8666918..0000000
--- a/xata/internal/fern-workspace/generated/go/create_branch_request.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// CreateBranchRequest is an in-lined request used by the CreateBranch endpoint.
-type CreateBranchRequest struct {
- // Name of source branch to branch the new schema from
- From *string `json:"-"`
- // Select the branch to fork from. Defaults to 'main'
- CreateBranchRequestFrom *string `json:"from,omitempty"`
- Metadata *BranchMetadata `json:"metadata,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/create_branch_response.go b/xata/internal/fern-workspace/generated/go/create_branch_response.go
deleted file mode 100644
index f370331..0000000
--- a/xata/internal/fern-workspace/generated/go/create_branch_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type CreateBranchResponse struct {
- BranchName string `json:"branchName"`
- // `non-empty`
- DatabaseName string `json:"databaseName"`
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/create_table_response.go b/xata/internal/fern-workspace/generated/go/create_table_response.go
deleted file mode 100644
index a88b8c7..0000000
--- a/xata/internal/fern-workspace/generated/go/create_table_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type CreateTableResponse struct {
- BranchName string `json:"branchName"`
- Status MigrationStatus `json:"status,omitempty"`
- // `non-empty`
- TableName string `json:"tableName"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/data_input_record.go b/xata/internal/fern-workspace/generated/go/data_input_record.go
deleted file mode 100644
index fcc846c..0000000
--- a/xata/internal/fern-workspace/generated/go/data_input_record.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Xata input record
-type DataInputRecord = map[string]*DataInputRecordValue
diff --git a/xata/internal/fern-workspace/generated/go/data_input_record_value.go b/xata/internal/fern-workspace/generated/go/data_input_record_value.go
deleted file mode 100644
index 6645185..0000000
--- a/xata/internal/fern-workspace/generated/go/data_input_record_value.go
+++ /dev/null
@@ -1,193 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type DataInputRecordValue struct {
- typeName string
- RecordId RecordId
- String string
- Boolean bool
- Double float64
- StringList []string
- DoubleList []float64
- DateTime DateTime
- ObjectValue ObjectValue
- InputFileArray InputFileArray
- InputFile *InputFile
-}
-
-func NewDataInputRecordValueFromRecordId(value RecordId) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "recordId", RecordId: value}
-}
-
-func NewDataInputRecordValueFromString(value string) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "string", String: value}
-}
-
-func NewDataInputRecordValueFromBoolean(value bool) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "boolean", Boolean: value}
-}
-
-func NewDataInputRecordValueFromDouble(value float64) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "double", Double: value}
-}
-
-func NewDataInputRecordValueFromStringList(value []string) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "stringList", StringList: value}
-}
-
-func NewDataInputRecordValueFromDoubleList(value []float64) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "doubleList", DoubleList: value}
-}
-
-func NewDataInputRecordValueFromDateTime(value DateTime) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "dateTime", DateTime: value}
-}
-
-func NewDataInputRecordValueFromObjectValue(value ObjectValue) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "objectValue", ObjectValue: value}
-}
-
-func NewDataInputRecordValueFromInputFileArray(value InputFileArray) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "inputFileArray", InputFileArray: value}
-}
-
-func NewDataInputRecordValueFromInputFile(value *InputFile) *DataInputRecordValue {
- return &DataInputRecordValue{typeName: "inputFile", InputFile: value}
-}
-
-func (d *DataInputRecordValue) UnmarshalJSON(data []byte) error {
- var valueRecordId RecordId
- if err := json.Unmarshal(data, &valueRecordId); err == nil {
- d.typeName = "recordId"
- d.RecordId = valueRecordId
- return nil
- }
- var valueString string
- if err := json.Unmarshal(data, &valueString); err == nil {
- d.typeName = "string"
- d.String = valueString
- return nil
- }
- var valueBoolean bool
- if err := json.Unmarshal(data, &valueBoolean); err == nil {
- d.typeName = "boolean"
- d.Boolean = valueBoolean
- return nil
- }
- var valueDouble float64
- if err := json.Unmarshal(data, &valueDouble); err == nil {
- d.typeName = "double"
- d.Double = valueDouble
- return nil
- }
- var valueStringList []string
- if err := json.Unmarshal(data, &valueStringList); err == nil {
- d.typeName = "stringList"
- d.StringList = valueStringList
- return nil
- }
- var valueDoubleList []float64
- if err := json.Unmarshal(data, &valueDoubleList); err == nil {
- d.typeName = "doubleList"
- d.DoubleList = valueDoubleList
- return nil
- }
- var valueDateTime DateTime
- if err := json.Unmarshal(data, &valueDateTime); err == nil {
- d.typeName = "dateTime"
- d.DateTime = valueDateTime
- return nil
- }
- var valueObjectValue ObjectValue
- if err := json.Unmarshal(data, &valueObjectValue); err == nil {
- d.typeName = "objectValue"
- d.ObjectValue = valueObjectValue
- return nil
- }
- var valueInputFileArray InputFileArray
- if err := json.Unmarshal(data, &valueInputFileArray); err == nil {
- d.typeName = "inputFileArray"
- d.InputFileArray = valueInputFileArray
- return nil
- }
- valueInputFile := new(InputFile)
- if err := json.Unmarshal(data, &valueInputFile); err == nil {
- d.typeName = "inputFile"
- d.InputFile = valueInputFile
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, d)
-}
-
-func (d DataInputRecordValue) MarshalJSON() ([]byte, error) {
- switch d.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", d.typeName, d)
- case "recordId":
- return json.Marshal(d.RecordId)
- case "string":
- return json.Marshal(d.String)
- case "boolean":
- return json.Marshal(d.Boolean)
- case "double":
- return json.Marshal(d.Double)
- case "stringList":
- return json.Marshal(d.StringList)
- case "doubleList":
- return json.Marshal(d.DoubleList)
- case "dateTime":
- return json.Marshal(d.DateTime)
- case "objectValue":
- return json.Marshal(d.ObjectValue)
- case "inputFileArray":
- return json.Marshal(d.InputFileArray)
- case "inputFile":
- return json.Marshal(d.InputFile)
- }
-}
-
-type DataInputRecordValueVisitor interface {
- VisitRecordId(RecordId) error
- VisitString(string) error
- VisitBoolean(bool) error
- VisitDouble(float64) error
- VisitStringList([]string) error
- VisitDoubleList([]float64) error
- VisitDateTime(DateTime) error
- VisitObjectValue(ObjectValue) error
- VisitInputFileArray(InputFileArray) error
- VisitInputFile(*InputFile) error
-}
-
-func (d *DataInputRecordValue) Accept(v DataInputRecordValueVisitor) error {
- switch d.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", d.typeName, d)
- case "recordId":
- return v.VisitRecordId(d.RecordId)
- case "string":
- return v.VisitString(d.String)
- case "boolean":
- return v.VisitBoolean(d.Boolean)
- case "double":
- return v.VisitDouble(d.Double)
- case "stringList":
- return v.VisitStringList(d.StringList)
- case "doubleList":
- return v.VisitDoubleList(d.DoubleList)
- case "dateTime":
- return v.VisitDateTime(d.DateTime)
- case "objectValue":
- return v.VisitObjectValue(d.ObjectValue)
- case "inputFileArray":
- return v.VisitInputFileArray(d.InputFileArray)
- case "inputFile":
- return v.VisitInputFile(d.InputFile)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/date_booster.go b/xata/internal/fern-workspace/generated/go/date_booster.go
deleted file mode 100644
index a96eb0b..0000000
--- a/xata/internal/fern-workspace/generated/go/date_booster.go
+++ /dev/null
@@ -1,22 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Boost records based on the value of a datetime column. It is configured via "origin", "scale", and "decay". The further away from the "origin",
-// the more the score is decayed. The decay function uses an exponential function. For example if origin is "now", and scale is 10 days and decay is 0.5, it
-// should be interpreted as: a record with a date 10 days before/after origin will be boosted 2 times less than a record with the date at origin.
-// The result of the exponential function is a boost between 0 and 1. The "factor" allows you to control how impactful this boost is, by multiplying it with a given value.
-type DateBooster struct {
- // The column in which to look for the value.
- Column string `json:"column"`
- // The decay factor to expect at "scale" distance from the "origin".
- Decay float64 `json:"decay"`
- // The factor with which to multiply the added boost.
- Factor *float64 `json:"factor,omitempty"`
- IfMatchesFilter *FilterExpression `json:"ifMatchesFilter,omitempty"`
- // The datetime (formatted as RFC3339) from where to apply the score decay function. The maximum boost will be applied for records with values at this time.
- // If it is not specified, the current date and time is used.
- Origin *string `json:"origin,omitempty"`
- // The duration at which distance from origin the score is decayed with factor, using an exponential function. It is formatted as number + units, for example: `5d`, `20m`, `10s`.
- Scale string `json:"scale"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/date_histogram_agg.go b/xata/internal/fern-workspace/generated/go/date_histogram_agg.go
deleted file mode 100644
index df6346e..0000000
--- a/xata/internal/fern-workspace/generated/go/date_histogram_agg.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Split data into buckets by a datetime column. Accepts sub-aggregations for each bucket.
-type DateHistogramAgg struct {
- Aggs *AggExpressionMap `json:"aggs,omitempty"`
- // The calendar-aware interval to use when bucketing. Possible values are: `minute`,
- // `hour`, `day`, `week`, `month`, `quarter`, `year`.
- CalendarInterval *DateHistogramAggCalendarInterval `json:"calendarInterval,omitempty"`
- // The column to use for bucketing. Must be of type datetime.
- Column string `json:"column"`
- // The fixed interval to use when bucketing.
- // It is formatted as number + units, for example: `5d`, `20m`, `10s`.
- Interval *string `json:"interval,omitempty"`
- // The timezone to use for bucketing. By default, UTC is assumed.
- // The accepted format is as an ISO 8601 UTC offset. For example: `+01:00` or
- // `-08:00`.
- Timezone *string `json:"timezone,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/date_histogram_agg_calendar_interval.go b/xata/internal/fern-workspace/generated/go/date_histogram_agg_calendar_interval.go
deleted file mode 100644
index 3924df2..0000000
--- a/xata/internal/fern-workspace/generated/go/date_histogram_agg_calendar_interval.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-// The calendar-aware interval to use when bucketing. Possible values are: `minute`,
-// `hour`, `day`, `week`, `month`, `quarter`, `year`.
-type DateHistogramAggCalendarInterval uint8
-
-const (
- DateHistogramAggCalendarIntervalMinute DateHistogramAggCalendarInterval = iota + 1
- DateHistogramAggCalendarIntervalHour
- DateHistogramAggCalendarIntervalDay
- DateHistogramAggCalendarIntervalWeek
- DateHistogramAggCalendarIntervalMonth
- DateHistogramAggCalendarIntervalQuarter
- DateHistogramAggCalendarIntervalYear
-)
-
-func (d DateHistogramAggCalendarInterval) String() string {
- switch d {
- default:
- return strconv.Itoa(int(d))
- case DateHistogramAggCalendarIntervalMinute:
- return "minute"
- case DateHistogramAggCalendarIntervalHour:
- return "hour"
- case DateHistogramAggCalendarIntervalDay:
- return "day"
- case DateHistogramAggCalendarIntervalWeek:
- return "week"
- case DateHistogramAggCalendarIntervalMonth:
- return "month"
- case DateHistogramAggCalendarIntervalQuarter:
- return "quarter"
- case DateHistogramAggCalendarIntervalYear:
- return "year"
- }
-}
-
-func (d DateHistogramAggCalendarInterval) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", d.String())), nil
-}
-
-func (d *DateHistogramAggCalendarInterval) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "minute":
- value := DateHistogramAggCalendarIntervalMinute
- *d = value
- case "hour":
- value := DateHistogramAggCalendarIntervalHour
- *d = value
- case "day":
- value := DateHistogramAggCalendarIntervalDay
- *d = value
- case "week":
- value := DateHistogramAggCalendarIntervalWeek
- *d = value
- case "month":
- value := DateHistogramAggCalendarIntervalMonth
- *d = value
- case "quarter":
- value := DateHistogramAggCalendarIntervalQuarter
- *d = value
- case "year":
- value := DateHistogramAggCalendarIntervalYear
- *d = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/date_time.go b/xata/internal/fern-workspace/generated/go/date_time.go
deleted file mode 100644
index c0d5a95..0000000
--- a/xata/internal/fern-workspace/generated/go/date_time.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- time "time"
-)
-
-type DateTime = time.Time
diff --git a/xata/internal/fern-workspace/generated/go/db_branch.go b/xata/internal/fern-workspace/generated/go/db_branch.go
deleted file mode 100644
index c4862b9..0000000
--- a/xata/internal/fern-workspace/generated/go/db_branch.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type DbBranch struct {
- BranchName BranchName `json:"branchName"`
- CreatedAt DateTime `json:"createdAt"`
- DatabaseName DbName `json:"databaseName"`
- Id string `json:"id"`
- LastMigrationId string `json:"lastMigrationID"`
- Metadata *BranchMetadata `json:"metadata,omitempty"`
- Schema *Schema `json:"schema,omitempty"`
- StartedFrom *StartedFromMetadata `json:"startedFrom,omitempty"`
- Version float64 `json:"version"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/db_branch_name.go b/xata/internal/fern-workspace/generated/go/db_branch_name.go
deleted file mode 100644
index 2f07c39..0000000
--- a/xata/internal/fern-workspace/generated/go/db_branch_name.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// `non-empty` `<= 511 characters`
-type DbBranchName = string
diff --git a/xata/internal/fern-workspace/generated/go/db_name.go b/xata/internal/fern-workspace/generated/go/db_name.go
deleted file mode 100644
index 031867d..0000000
--- a/xata/internal/fern-workspace/generated/go/db_name.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// `non-empty` `<= 255 characters`
-type DbName = string
diff --git a/xata/internal/fern-workspace/generated/go/delete_branch_response.go b/xata/internal/fern-workspace/generated/go/delete_branch_response.go
deleted file mode 100644
index 7709e1e..0000000
--- a/xata/internal/fern-workspace/generated/go/delete_branch_response.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type DeleteBranchResponse struct {
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/delete_column_response.go b/xata/internal/fern-workspace/generated/go/delete_column_response.go
deleted file mode 100644
index 6aeafe3..0000000
--- a/xata/internal/fern-workspace/generated/go/delete_column_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type DeleteColumnResponse struct {
- // `non-empty`
- MigrationId string `json:"migrationID"`
- ParentMigrationId string `json:"parentMigrationID"`
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/delete_record_request.go b/xata/internal/fern-workspace/generated/go/delete_record_request.go
deleted file mode 100644
index a03429c..0000000
--- a/xata/internal/fern-workspace/generated/go/delete_record_request.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// DeleteRecordRequest is an in-lined request used by the DeleteRecord endpoint.
-type DeleteRecordRequest struct {
- // Column filters
- Columns []*string `json:"-"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/delete_table_response.go b/xata/internal/fern-workspace/generated/go/delete_table_response.go
deleted file mode 100644
index 72aceb7..0000000
--- a/xata/internal/fern-workspace/generated/go/delete_table_response.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type DeleteTableResponse struct {
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/doc.go b/xata/internal/fern-workspace/generated/go/doc.go
deleted file mode 100644
index 9af7417..0000000
--- a/xata/internal/fern-workspace/generated/go/doc.go
+++ /dev/null
@@ -1,4 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-// CRUD API for operating on binary content in file and file[] columns.
-package api
diff --git a/xata/internal/fern-workspace/generated/go/environments.go b/xata/internal/fern-workspace/generated/go/environments.go
deleted file mode 100644
index 133438d..0000000
--- a/xata/internal/fern-workspace/generated/go/environments.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Environments defines all of the API environments.
-// These values can be used with the ClientWithBaseURL
-// ClientOption to override the client's default environment,
-// if any.
-var Environments = struct {
- Default string
-}{
- Default: "/",
-}
diff --git a/xata/internal/fern-workspace/generated/go/file_access_id.go b/xata/internal/fern-workspace/generated/go/file_access_id.go
deleted file mode 100644
index f22535d..0000000
--- a/xata/internal/fern-workspace/generated/go/file_access_id.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// File identifier in access URLs `<= 296 characters`
-type FileAccessId = string
diff --git a/xata/internal/fern-workspace/generated/go/file_item_id.go b/xata/internal/fern-workspace/generated/go/file_item_id.go
deleted file mode 100644
index 66bbe89..0000000
--- a/xata/internal/fern-workspace/generated/go/file_item_id.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Unique file identifier `non-empty` `<= 255 characters`
-type FileItemId = string
diff --git a/xata/internal/fern-workspace/generated/go/file_name.go b/xata/internal/fern-workspace/generated/go/file_name.go
deleted file mode 100644
index 967563c..0000000
--- a/xata/internal/fern-workspace/generated/go/file_name.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// File name `<= 1024 characters`
-type FileName = string
diff --git a/xata/internal/fern-workspace/generated/go/file_response.go b/xata/internal/fern-workspace/generated/go/file_response.go
deleted file mode 100644
index 7454ef6..0000000
--- a/xata/internal/fern-workspace/generated/go/file_response.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// File metadata
-type FileResponse struct {
- Attributes *map[string]any `json:"attributes,omitempty"`
- Id *FileItemId `json:"id,omitempty"`
- MediaType MediaType `json:"mediaType"`
- Name FileName `json:"name"`
- Size int `json:"size"`
- Version int `json:"version"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/file_signature.go b/xata/internal/fern-workspace/generated/go/file_signature.go
deleted file mode 100644
index dbe1465..0000000
--- a/xata/internal/fern-workspace/generated/go/file_signature.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// File signature
-type FileSignature = string
diff --git a/xata/internal/fern-workspace/generated/go/files_client.go b/xata/internal/fern-workspace/generated/go/files_client.go
deleted file mode 100644
index 04b082b..0000000
--- a/xata/internal/fern-workspace/generated/go/files_client.go
+++ /dev/null
@@ -1,440 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- bytes "bytes"
- context "context"
- json "encoding/json"
- errors "errors"
- fmt "fmt"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
- io "io"
- http "net/http"
-)
-
-type FilesClient interface {
- GetFile(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName) error
- PutFile(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName) (*FileResponse, error)
- DeleteFile(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName) (*FileResponse, error)
- GetFileItem(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName, fileId FileItemId) error
- PutFileItem(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName, fileId FileItemId) (*FileResponse, error)
- DeleteFileItem(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName, fileId FileItemId) (*FileResponse, error)
-}
-
-func NewFilesClient(opts ...core.ClientOption) FilesClient {
- options := core.NewClientOptions()
- for _, opt := range opts {
- opt(options)
- }
- return &filesClient{
- baseURL: options.BaseURL,
- httpClient: options.HTTPClient,
- header: options.ToHeader(),
- }
-}
-
-type filesClient struct {
- baseURL string
- httpClient core.HTTPClient
- header http.Header
-}
-
-// Retrieves the file content from a file column
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-// The Column name
-func (f *filesClient) GetFile(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName) error {
- baseURL := "/"
- if f.baseURL != "" {
- baseURL = f.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v/column/%v/file", dbBranchName, tableName, recordId, columnName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- if err := core.DoRequest(
- ctx,
- f.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- nil,
- false,
- f.header,
- errorDecoder,
- ); err != nil {
- return err
- }
- return nil
-}
-
-// Uploads the file content to the given file column
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-// The Column name
-func (f *filesClient) PutFile(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName) (*FileResponse, error) {
- baseURL := "/"
- if f.baseURL != "" {
- baseURL = f.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v/column/%v/file", dbBranchName, tableName, recordId, columnName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 422:
- value := new(UnprocessableEntityError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *FileResponse
- if err := core.DoRequest(
- ctx,
- f.httpClient,
- endpointURL,
- http.MethodPut,
- nil,
- &response,
- false,
- f.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Deletes a file referred in a file column
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-// The Column name
-func (f *filesClient) DeleteFile(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName) (*FileResponse, error) {
- baseURL := "/"
- if f.baseURL != "" {
- baseURL = f.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v/column/%v/file", dbBranchName, tableName, recordId, columnName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *FileResponse
- if err := core.DoRequest(
- ctx,
- f.httpClient,
- endpointURL,
- http.MethodDelete,
- nil,
- &response,
- false,
- f.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Retrieves file content from an array by file ID
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-// The Column name
-// The File Identifier
-func (f *filesClient) GetFileItem(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName, fileId FileItemId) error {
- baseURL := "/"
- if f.baseURL != "" {
- baseURL = f.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v/column/%v/file/%v", dbBranchName, tableName, recordId, columnName, fileId)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- if err := core.DoRequest(
- ctx,
- f.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- nil,
- false,
- f.header,
- errorDecoder,
- ); err != nil {
- return err
- }
- return nil
-}
-
-// Uploads the file content to an array given the file ID
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-// The Column name
-// The File Identifier
-func (f *filesClient) PutFileItem(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName, fileId FileItemId) (*FileResponse, error) {
- baseURL := "/"
- if f.baseURL != "" {
- baseURL = f.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v/column/%v/file/%v", dbBranchName, tableName, recordId, columnName, fileId)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 422:
- value := new(UnprocessableEntityError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *FileResponse
- if err := core.DoRequest(
- ctx,
- f.httpClient,
- endpointURL,
- http.MethodPut,
- nil,
- &response,
- false,
- f.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Deletes an item from an file array column given the file ID
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-// The Column name
-// The File Identifier
-func (f *filesClient) DeleteFileItem(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, columnName ColumnName, fileId FileItemId) (*FileResponse, error) {
- baseURL := "/"
- if f.baseURL != "" {
- baseURL = f.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v/column/%v/file/%v", dbBranchName, tableName, recordId, columnName, fileId)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *FileResponse
- if err := core.DoRequest(
- ctx,
- f.httpClient,
- endpointURL,
- http.MethodDelete,
- nil,
- &response,
- false,
- f.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_column.go b/xata/internal/fern-workspace/generated/go/filter_column.go
deleted file mode 100644
index f56eb58..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_column.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type FilterColumn struct {
- typeName string
- FilterColumnIncludes *FilterColumnIncludes
- FilterPredicate *FilterPredicate
- FilterList *FilterList
-}
-
-func NewFilterColumnFromFilterColumnIncludes(value *FilterColumnIncludes) *FilterColumn {
- return &FilterColumn{typeName: "filterColumnIncludes", FilterColumnIncludes: value}
-}
-
-func NewFilterColumnFromFilterPredicate(value *FilterPredicate) *FilterColumn {
- return &FilterColumn{typeName: "filterPredicate", FilterPredicate: value}
-}
-
-func NewFilterColumnFromFilterList(value *FilterList) *FilterColumn {
- return &FilterColumn{typeName: "filterList", FilterList: value}
-}
-
-func (f *FilterColumn) UnmarshalJSON(data []byte) error {
- valueFilterColumnIncludes := new(FilterColumnIncludes)
- if err := json.Unmarshal(data, &valueFilterColumnIncludes); err == nil {
- f.typeName = "filterColumnIncludes"
- f.FilterColumnIncludes = valueFilterColumnIncludes
- return nil
- }
- valueFilterPredicate := new(FilterPredicate)
- if err := json.Unmarshal(data, &valueFilterPredicate); err == nil {
- f.typeName = "filterPredicate"
- f.FilterPredicate = valueFilterPredicate
- return nil
- }
- valueFilterList := new(FilterList)
- if err := json.Unmarshal(data, &valueFilterList); err == nil {
- f.typeName = "filterList"
- f.FilterList = valueFilterList
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, f)
-}
-
-func (f FilterColumn) MarshalJSON() ([]byte, error) {
- switch f.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterColumnIncludes":
- return json.Marshal(f.FilterColumnIncludes)
- case "filterPredicate":
- return json.Marshal(f.FilterPredicate)
- case "filterList":
- return json.Marshal(f.FilterList)
- }
-}
-
-type FilterColumnVisitor interface {
- VisitFilterColumnIncludes(*FilterColumnIncludes) error
- VisitFilterPredicate(*FilterPredicate) error
- VisitFilterList(*FilterList) error
-}
-
-func (f *FilterColumn) Accept(v FilterColumnVisitor) error {
- switch f.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterColumnIncludes":
- return v.VisitFilterColumnIncludes(f.FilterColumnIncludes)
- case "filterPredicate":
- return v.VisitFilterPredicate(f.FilterPredicate)
- case "filterList":
- return v.VisitFilterList(f.FilterList)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_column_includes.go b/xata/internal/fern-workspace/generated/go/filter_column_includes.go
deleted file mode 100644
index 7e78baf..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_column_includes.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type FilterColumnIncludes struct {
- Includes *FilterPredicate `json:"$includes,omitempty"`
- IncludesAll *FilterPredicate `json:"$includesAll,omitempty"`
- IncludesAny *FilterPredicate `json:"$includesAny,omitempty"`
- IncludesNone *FilterPredicate `json:"$includesNone,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_expression.go b/xata/internal/fern-workspace/generated/go/filter_expression.go
deleted file mode 100644
index 5b6e4de..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_expression.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type FilterExpression struct {
- All *FilterList `json:"$all,omitempty"`
- Any *FilterList `json:"$any,omitempty"`
- Exists *string `json:"$exists,omitempty"`
- ExistsNot *string `json:"$existsNot,omitempty"`
- None *FilterList `json:"$none,omitempty"`
- Not *FilterList `json:"$not,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_list.go b/xata/internal/fern-workspace/generated/go/filter_list.go
deleted file mode 100644
index 1bc0df9..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_list.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type FilterList struct {
- typeName string
- FilterExpression *FilterExpression
- FilterExpressionList []*FilterExpression
-}
-
-func NewFilterListFromFilterExpression(value *FilterExpression) *FilterList {
- return &FilterList{typeName: "filterExpression", FilterExpression: value}
-}
-
-func NewFilterListFromFilterExpressionList(value []*FilterExpression) *FilterList {
- return &FilterList{typeName: "filterExpressionList", FilterExpressionList: value}
-}
-
-func (f *FilterList) UnmarshalJSON(data []byte) error {
- valueFilterExpression := new(FilterExpression)
- if err := json.Unmarshal(data, &valueFilterExpression); err == nil {
- f.typeName = "filterExpression"
- f.FilterExpression = valueFilterExpression
- return nil
- }
- var valueFilterExpressionList []*FilterExpression
- if err := json.Unmarshal(data, &valueFilterExpressionList); err == nil {
- f.typeName = "filterExpressionList"
- f.FilterExpressionList = valueFilterExpressionList
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, f)
-}
-
-func (f FilterList) MarshalJSON() ([]byte, error) {
- switch f.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterExpression":
- return json.Marshal(f.FilterExpression)
- case "filterExpressionList":
- return json.Marshal(f.FilterExpressionList)
- }
-}
-
-type FilterListVisitor interface {
- VisitFilterExpression(*FilterExpression) error
- VisitFilterExpressionList([]*FilterExpression) error
-}
-
-func (f *FilterList) Accept(v FilterListVisitor) error {
- switch f.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterExpression":
- return v.VisitFilterExpression(f.FilterExpression)
- case "filterExpressionList":
- return v.VisitFilterExpressionList(f.FilterExpressionList)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_predicate.go b/xata/internal/fern-workspace/generated/go/filter_predicate.go
deleted file mode 100644
index 7683f50..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_predicate.go
+++ /dev/null
@@ -1,97 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type FilterPredicate struct {
- typeName string
- FilterValue *FilterValue
- FilterPredicateList []*FilterPredicate
- FilterPredicateOp *FilterPredicateOp
- FilterPredicateRangeOp *FilterPredicateRangeOp
-}
-
-func NewFilterPredicateFromFilterValue(value *FilterValue) *FilterPredicate {
- return &FilterPredicate{typeName: "filterValue", FilterValue: value}
-}
-
-func NewFilterPredicateFromFilterPredicateList(value []*FilterPredicate) *FilterPredicate {
- return &FilterPredicate{typeName: "filterPredicateList", FilterPredicateList: value}
-}
-
-func NewFilterPredicateFromFilterPredicateOp(value *FilterPredicateOp) *FilterPredicate {
- return &FilterPredicate{typeName: "filterPredicateOp", FilterPredicateOp: value}
-}
-
-func NewFilterPredicateFromFilterPredicateRangeOp(value *FilterPredicateRangeOp) *FilterPredicate {
- return &FilterPredicate{typeName: "filterPredicateRangeOp", FilterPredicateRangeOp: value}
-}
-
-func (f *FilterPredicate) UnmarshalJSON(data []byte) error {
- valueFilterValue := new(FilterValue)
- if err := json.Unmarshal(data, &valueFilterValue); err == nil {
- f.typeName = "filterValue"
- f.FilterValue = valueFilterValue
- return nil
- }
- var valueFilterPredicateList []*FilterPredicate
- if err := json.Unmarshal(data, &valueFilterPredicateList); err == nil {
- f.typeName = "filterPredicateList"
- f.FilterPredicateList = valueFilterPredicateList
- return nil
- }
- valueFilterPredicateOp := new(FilterPredicateOp)
- if err := json.Unmarshal(data, &valueFilterPredicateOp); err == nil {
- f.typeName = "filterPredicateOp"
- f.FilterPredicateOp = valueFilterPredicateOp
- return nil
- }
- valueFilterPredicateRangeOp := new(FilterPredicateRangeOp)
- if err := json.Unmarshal(data, &valueFilterPredicateRangeOp); err == nil {
- f.typeName = "filterPredicateRangeOp"
- f.FilterPredicateRangeOp = valueFilterPredicateRangeOp
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, f)
-}
-
-func (f FilterPredicate) MarshalJSON() ([]byte, error) {
- switch f.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterValue":
- return json.Marshal(f.FilterValue)
- case "filterPredicateList":
- return json.Marshal(f.FilterPredicateList)
- case "filterPredicateOp":
- return json.Marshal(f.FilterPredicateOp)
- case "filterPredicateRangeOp":
- return json.Marshal(f.FilterPredicateRangeOp)
- }
-}
-
-type FilterPredicateVisitor interface {
- VisitFilterValue(*FilterValue) error
- VisitFilterPredicateList([]*FilterPredicate) error
- VisitFilterPredicateOp(*FilterPredicateOp) error
- VisitFilterPredicateRangeOp(*FilterPredicateRangeOp) error
-}
-
-func (f *FilterPredicate) Accept(v FilterPredicateVisitor) error {
- switch f.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterValue":
- return v.VisitFilterValue(f.FilterValue)
- case "filterPredicateList":
- return v.VisitFilterPredicateList(f.FilterPredicateList)
- case "filterPredicateOp":
- return v.VisitFilterPredicateOp(f.FilterPredicateOp)
- case "filterPredicateRangeOp":
- return v.VisitFilterPredicateRangeOp(f.FilterPredicateRangeOp)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_predicate_op.go b/xata/internal/fern-workspace/generated/go/filter_predicate_op.go
deleted file mode 100644
index 846a474..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_predicate_op.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type FilterPredicateOp struct {
- All *[]*FilterPredicate `json:"$all,omitempty"`
- Any *[]*FilterPredicate `json:"$any,omitempty"`
- Contains *string `json:"$contains,omitempty"`
- EndsWith *string `json:"$endsWith,omitempty"`
- Ge *FilterRangeValue `json:"$ge,omitempty"`
- Gt *FilterRangeValue `json:"$gt,omitempty"`
- Is *FilterPredicateOpIs `json:"$is,omitempty"`
- IsNot *FilterPredicateOpIsNot `json:"$isNot,omitempty"`
- Le *FilterRangeValue `json:"$le,omitempty"`
- Lt *FilterRangeValue `json:"$lt,omitempty"`
- None *FilterPredicateOpNone `json:"$none,omitempty"`
- Not *FilterPredicateOpNot `json:"$not,omitempty"`
- Pattern *string `json:"$pattern,omitempty"`
- StartsWith *string `json:"$startsWith,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_predicate_op_is.go b/xata/internal/fern-workspace/generated/go/filter_predicate_op_is.go
deleted file mode 100644
index 0e83d4b..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_predicate_op_is.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type FilterPredicateOpIs struct {
- typeName string
- FilterValue *FilterValue
- FilterValueList []*FilterValue
-}
-
-func NewFilterPredicateOpIsFromFilterValue(value *FilterValue) *FilterPredicateOpIs {
- return &FilterPredicateOpIs{typeName: "filterValue", FilterValue: value}
-}
-
-func NewFilterPredicateOpIsFromFilterValueList(value []*FilterValue) *FilterPredicateOpIs {
- return &FilterPredicateOpIs{typeName: "filterValueList", FilterValueList: value}
-}
-
-func (f *FilterPredicateOpIs) UnmarshalJSON(data []byte) error {
- valueFilterValue := new(FilterValue)
- if err := json.Unmarshal(data, &valueFilterValue); err == nil {
- f.typeName = "filterValue"
- f.FilterValue = valueFilterValue
- return nil
- }
- var valueFilterValueList []*FilterValue
- if err := json.Unmarshal(data, &valueFilterValueList); err == nil {
- f.typeName = "filterValueList"
- f.FilterValueList = valueFilterValueList
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, f)
-}
-
-func (f FilterPredicateOpIs) MarshalJSON() ([]byte, error) {
- switch f.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterValue":
- return json.Marshal(f.FilterValue)
- case "filterValueList":
- return json.Marshal(f.FilterValueList)
- }
-}
-
-type FilterPredicateOpIsVisitor interface {
- VisitFilterValue(*FilterValue) error
- VisitFilterValueList([]*FilterValue) error
-}
-
-func (f *FilterPredicateOpIs) Accept(v FilterPredicateOpIsVisitor) error {
- switch f.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterValue":
- return v.VisitFilterValue(f.FilterValue)
- case "filterValueList":
- return v.VisitFilterValueList(f.FilterValueList)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_predicate_op_is_not.go b/xata/internal/fern-workspace/generated/go/filter_predicate_op_is_not.go
deleted file mode 100644
index d2b3281..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_predicate_op_is_not.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type FilterPredicateOpIsNot struct {
- typeName string
- FilterValue *FilterValue
- FilterValueList []*FilterValue
-}
-
-func NewFilterPredicateOpIsNotFromFilterValue(value *FilterValue) *FilterPredicateOpIsNot {
- return &FilterPredicateOpIsNot{typeName: "filterValue", FilterValue: value}
-}
-
-func NewFilterPredicateOpIsNotFromFilterValueList(value []*FilterValue) *FilterPredicateOpIsNot {
- return &FilterPredicateOpIsNot{typeName: "filterValueList", FilterValueList: value}
-}
-
-func (f *FilterPredicateOpIsNot) UnmarshalJSON(data []byte) error {
- valueFilterValue := new(FilterValue)
- if err := json.Unmarshal(data, &valueFilterValue); err == nil {
- f.typeName = "filterValue"
- f.FilterValue = valueFilterValue
- return nil
- }
- var valueFilterValueList []*FilterValue
- if err := json.Unmarshal(data, &valueFilterValueList); err == nil {
- f.typeName = "filterValueList"
- f.FilterValueList = valueFilterValueList
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, f)
-}
-
-func (f FilterPredicateOpIsNot) MarshalJSON() ([]byte, error) {
- switch f.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterValue":
- return json.Marshal(f.FilterValue)
- case "filterValueList":
- return json.Marshal(f.FilterValueList)
- }
-}
-
-type FilterPredicateOpIsNotVisitor interface {
- VisitFilterValue(*FilterValue) error
- VisitFilterValueList([]*FilterValue) error
-}
-
-func (f *FilterPredicateOpIsNot) Accept(v FilterPredicateOpIsNotVisitor) error {
- switch f.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterValue":
- return v.VisitFilterValue(f.FilterValue)
- case "filterValueList":
- return v.VisitFilterValueList(f.FilterValueList)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_predicate_op_none.go b/xata/internal/fern-workspace/generated/go/filter_predicate_op_none.go
deleted file mode 100644
index edd0b60..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_predicate_op_none.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type FilterPredicateOpNone struct {
- typeName string
- FilterPredicate *FilterPredicate
- FilterPredicateList []*FilterPredicate
-}
-
-func NewFilterPredicateOpNoneFromFilterPredicate(value *FilterPredicate) *FilterPredicateOpNone {
- return &FilterPredicateOpNone{typeName: "filterPredicate", FilterPredicate: value}
-}
-
-func NewFilterPredicateOpNoneFromFilterPredicateList(value []*FilterPredicate) *FilterPredicateOpNone {
- return &FilterPredicateOpNone{typeName: "filterPredicateList", FilterPredicateList: value}
-}
-
-func (f *FilterPredicateOpNone) UnmarshalJSON(data []byte) error {
- valueFilterPredicate := new(FilterPredicate)
- if err := json.Unmarshal(data, &valueFilterPredicate); err == nil {
- f.typeName = "filterPredicate"
- f.FilterPredicate = valueFilterPredicate
- return nil
- }
- var valueFilterPredicateList []*FilterPredicate
- if err := json.Unmarshal(data, &valueFilterPredicateList); err == nil {
- f.typeName = "filterPredicateList"
- f.FilterPredicateList = valueFilterPredicateList
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, f)
-}
-
-func (f FilterPredicateOpNone) MarshalJSON() ([]byte, error) {
- switch f.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterPredicate":
- return json.Marshal(f.FilterPredicate)
- case "filterPredicateList":
- return json.Marshal(f.FilterPredicateList)
- }
-}
-
-type FilterPredicateOpNoneVisitor interface {
- VisitFilterPredicate(*FilterPredicate) error
- VisitFilterPredicateList([]*FilterPredicate) error
-}
-
-func (f *FilterPredicateOpNone) Accept(v FilterPredicateOpNoneVisitor) error {
- switch f.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterPredicate":
- return v.VisitFilterPredicate(f.FilterPredicate)
- case "filterPredicateList":
- return v.VisitFilterPredicateList(f.FilterPredicateList)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_predicate_op_not.go b/xata/internal/fern-workspace/generated/go/filter_predicate_op_not.go
deleted file mode 100644
index 2dd6fe7..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_predicate_op_not.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type FilterPredicateOpNot struct {
- typeName string
- FilterPredicate *FilterPredicate
- FilterPredicateList []*FilterPredicate
-}
-
-func NewFilterPredicateOpNotFromFilterPredicate(value *FilterPredicate) *FilterPredicateOpNot {
- return &FilterPredicateOpNot{typeName: "filterPredicate", FilterPredicate: value}
-}
-
-func NewFilterPredicateOpNotFromFilterPredicateList(value []*FilterPredicate) *FilterPredicateOpNot {
- return &FilterPredicateOpNot{typeName: "filterPredicateList", FilterPredicateList: value}
-}
-
-func (f *FilterPredicateOpNot) UnmarshalJSON(data []byte) error {
- valueFilterPredicate := new(FilterPredicate)
- if err := json.Unmarshal(data, &valueFilterPredicate); err == nil {
- f.typeName = "filterPredicate"
- f.FilterPredicate = valueFilterPredicate
- return nil
- }
- var valueFilterPredicateList []*FilterPredicate
- if err := json.Unmarshal(data, &valueFilterPredicateList); err == nil {
- f.typeName = "filterPredicateList"
- f.FilterPredicateList = valueFilterPredicateList
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, f)
-}
-
-func (f FilterPredicateOpNot) MarshalJSON() ([]byte, error) {
- switch f.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterPredicate":
- return json.Marshal(f.FilterPredicate)
- case "filterPredicateList":
- return json.Marshal(f.FilterPredicateList)
- }
-}
-
-type FilterPredicateOpNotVisitor interface {
- VisitFilterPredicate(*FilterPredicate) error
- VisitFilterPredicateList([]*FilterPredicate) error
-}
-
-func (f *FilterPredicateOpNot) Accept(v FilterPredicateOpNotVisitor) error {
- switch f.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "filterPredicate":
- return v.VisitFilterPredicate(f.FilterPredicate)
- case "filterPredicateList":
- return v.VisitFilterPredicateList(f.FilterPredicateList)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_predicate_range_op.go b/xata/internal/fern-workspace/generated/go/filter_predicate_range_op.go
deleted file mode 100644
index 3e7a1d6..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_predicate_range_op.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type FilterPredicateRangeOp struct {
- Ge *FilterRangeValue `json:"$ge,omitempty"`
- Gt *FilterRangeValue `json:"$gt,omitempty"`
- Le *FilterRangeValue `json:"$le,omitempty"`
- Lt *FilterRangeValue `json:"$lt,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_range_value.go b/xata/internal/fern-workspace/generated/go/filter_range_value.go
deleted file mode 100644
index 108c091..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_range_value.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type FilterRangeValue struct {
- typeName string
- Double float64
- String string
-}
-
-func NewFilterRangeValueFromDouble(value float64) *FilterRangeValue {
- return &FilterRangeValue{typeName: "double", Double: value}
-}
-
-func NewFilterRangeValueFromString(value string) *FilterRangeValue {
- return &FilterRangeValue{typeName: "string", String: value}
-}
-
-func (f *FilterRangeValue) UnmarshalJSON(data []byte) error {
- var valueDouble float64
- if err := json.Unmarshal(data, &valueDouble); err == nil {
- f.typeName = "double"
- f.Double = valueDouble
- return nil
- }
- var valueString string
- if err := json.Unmarshal(data, &valueString); err == nil {
- f.typeName = "string"
- f.String = valueString
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, f)
-}
-
-func (f FilterRangeValue) MarshalJSON() ([]byte, error) {
- switch f.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "double":
- return json.Marshal(f.Double)
- case "string":
- return json.Marshal(f.String)
- }
-}
-
-type FilterRangeValueVisitor interface {
- VisitDouble(float64) error
- VisitString(string) error
-}
-
-func (f *FilterRangeValue) Accept(v FilterRangeValueVisitor) error {
- switch f.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "double":
- return v.VisitDouble(f.Double)
- case "string":
- return v.VisitString(f.String)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/filter_value.go b/xata/internal/fern-workspace/generated/go/filter_value.go
deleted file mode 100644
index 6ab4c72..0000000
--- a/xata/internal/fern-workspace/generated/go/filter_value.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type FilterValue struct {
- typeName string
- Double float64
- String string
- Boolean bool
-}
-
-func NewFilterValueFromDouble(value float64) *FilterValue {
- return &FilterValue{typeName: "double", Double: value}
-}
-
-func NewFilterValueFromString(value string) *FilterValue {
- return &FilterValue{typeName: "string", String: value}
-}
-
-func NewFilterValueFromBoolean(value bool) *FilterValue {
- return &FilterValue{typeName: "boolean", Boolean: value}
-}
-
-func (f *FilterValue) UnmarshalJSON(data []byte) error {
- var valueDouble float64
- if err := json.Unmarshal(data, &valueDouble); err == nil {
- f.typeName = "double"
- f.Double = valueDouble
- return nil
- }
- var valueString string
- if err := json.Unmarshal(data, &valueString); err == nil {
- f.typeName = "string"
- f.String = valueString
- return nil
- }
- var valueBoolean bool
- if err := json.Unmarshal(data, &valueBoolean); err == nil {
- f.typeName = "boolean"
- f.Boolean = valueBoolean
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, f)
-}
-
-func (f FilterValue) MarshalJSON() ([]byte, error) {
- switch f.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "double":
- return json.Marshal(f.Double)
- case "string":
- return json.Marshal(f.String)
- case "boolean":
- return json.Marshal(f.Boolean)
- }
-}
-
-type FilterValueVisitor interface {
- VisitDouble(float64) error
- VisitString(string) error
- VisitBoolean(bool) error
-}
-
-func (f *FilterValue) Accept(v FilterValueVisitor) error {
- switch f.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", f.typeName, f)
- case "double":
- return v.VisitDouble(f.Double)
- case "string":
- return v.VisitString(f.String)
- case "boolean":
- return v.VisitBoolean(f.Boolean)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/fuzziness_expression.go b/xata/internal/fern-workspace/generated/go/fuzziness_expression.go
deleted file mode 100644
index 263b4fa..0000000
--- a/xata/internal/fern-workspace/generated/go/fuzziness_expression.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Maximum [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) for the search terms. The Levenshtein
-// distance is the number of one character changes needed to make two strings equal. The default is 1, meaning that single
-// character typos per word are tolerated by search. You can set it to 0 to remove the typo tolerance or set it to 2
-// to allow two typos in a word.
-type FuzzinessExpression = int
diff --git a/xata/internal/fern-workspace/generated/go/get_branch_schema_history_request.go b/xata/internal/fern-workspace/generated/go/get_branch_schema_history_request.go
deleted file mode 100644
index 51622fb..0000000
--- a/xata/internal/fern-workspace/generated/go/get_branch_schema_history_request.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// GetBranchSchemaHistoryRequest is an in-lined request used by the GetBranchSchemaHistory endpoint.
-type GetBranchSchemaHistoryRequest struct {
- Page *GetBranchSchemaHistoryRequestPage `json:"page,omitempty"`
- // Report only migrations that have been added since the given Migration ID.
- Since *string `json:"since,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/get_branch_schema_history_request_page.go b/xata/internal/fern-workspace/generated/go/get_branch_schema_history_request_page.go
deleted file mode 100644
index 68d091a..0000000
--- a/xata/internal/fern-workspace/generated/go/get_branch_schema_history_request_page.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type GetBranchSchemaHistoryRequestPage struct {
- // Query the next page that follow the cursor.
- After *string `json:"after,omitempty"`
- // Query the previous page before the cursor.
- Before *string `json:"before,omitempty"`
- // Set page size. If the size is missing it is read from the cursor. If no cursor is given xata will choose the default page size.
- Size *int `json:"size,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/get_branch_schema_history_response.go b/xata/internal/fern-workspace/generated/go/get_branch_schema_history_response.go
deleted file mode 100644
index 974e0d2..0000000
--- a/xata/internal/fern-workspace/generated/go/get_branch_schema_history_response.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type GetBranchSchemaHistoryResponse struct {
- Logs []*Commit `json:"logs,omitempty"`
- Meta *GetBranchSchemaHistoryResponseMeta `json:"meta,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/get_branch_schema_history_response_meta.go b/xata/internal/fern-workspace/generated/go/get_branch_schema_history_response_meta.go
deleted file mode 100644
index 4aebd66..0000000
--- a/xata/internal/fern-workspace/generated/go/get_branch_schema_history_response_meta.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type GetBranchSchemaHistoryResponseMeta struct {
- // last record id
- Cursor string `json:"cursor"`
- // true if more records can be fetch
- More bool `json:"more"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/get_branch_stats_response.go b/xata/internal/fern-workspace/generated/go/get_branch_stats_response.go
deleted file mode 100644
index cf31d07..0000000
--- a/xata/internal/fern-workspace/generated/go/get_branch_stats_response.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type GetBranchStatsResponse struct {
- Interval string `json:"interval"`
- NumberOfRecords *[]*MetricsDatapoint `json:"numberOfRecords,omitempty"`
- ReadLatency *MetricsLatency `json:"readLatency,omitempty"`
- ReadsOverTime *[]*MetricsDatapoint `json:"readsOverTime,omitempty"`
- Resolution string `json:"resolution"`
- Timestamp string `json:"timestamp"`
- Warning *string `json:"warning,omitempty"`
- WriteLatency *MetricsLatency `json:"writeLatency,omitempty"`
- WritesOverTime *[]*MetricsDatapoint `json:"writesOverTime,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/get_record_request.go b/xata/internal/fern-workspace/generated/go/get_record_request.go
deleted file mode 100644
index a796e1d..0000000
--- a/xata/internal/fern-workspace/generated/go/get_record_request.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// GetRecordRequest is an in-lined request used by the GetRecord endpoint.
-type GetRecordRequest struct {
- // Column filters
- Columns []*string `json:"-"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/get_table_columns_response.go b/xata/internal/fern-workspace/generated/go/get_table_columns_response.go
deleted file mode 100644
index 6d0484e..0000000
--- a/xata/internal/fern-workspace/generated/go/get_table_columns_response.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type GetTableColumnsResponse struct {
- Columns []*Column `json:"columns,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/get_table_schema_response.go b/xata/internal/fern-workspace/generated/go/get_table_schema_response.go
deleted file mode 100644
index e46767d..0000000
--- a/xata/internal/fern-workspace/generated/go/get_table_schema_response.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type GetTableSchemaResponse struct {
- Columns []*Column `json:"columns,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/highlight_expression.go b/xata/internal/fern-workspace/generated/go/highlight_expression.go
deleted file mode 100644
index 4279bd1..0000000
--- a/xata/internal/fern-workspace/generated/go/highlight_expression.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type HighlightExpression struct {
- // Set to `false` to disable highlighting. By default it is `true`.
- Enabled *bool `json:"enabled,omitempty"`
- // Set to `false` to disable HTML encoding in highlight snippets. By default it is `true`.
- EncodeHtml *bool `json:"encodeHTML,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/input_file.go b/xata/internal/fern-workspace/generated/go/input_file.go
deleted file mode 100644
index 6dc11d4..0000000
--- a/xata/internal/fern-workspace/generated/go/input_file.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Object representing a file
-type InputFile struct {
- // Base64 encoded content `<= 20971520 characters`
- Base64Content *string `json:"base64Content,omitempty"`
- // Enable public access to the file
- EnablePublicUrl *bool `json:"enablePublicUrl,omitempty"`
- MediaType *MediaType `json:"mediaType,omitempty"`
- Name FileName `json:"name"`
- // Time to live for signed URLs
- SignedUrlTimeout *int `json:"signedUrlTimeout,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/input_file_array.go b/xata/internal/fern-workspace/generated/go/input_file_array.go
deleted file mode 100644
index 047a459..0000000
--- a/xata/internal/fern-workspace/generated/go/input_file_array.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Array of file entries
-type InputFileArray = []*InputFileEntry
diff --git a/xata/internal/fern-workspace/generated/go/input_file_entry.go b/xata/internal/fern-workspace/generated/go/input_file_entry.go
deleted file mode 100644
index 87c5182..0000000
--- a/xata/internal/fern-workspace/generated/go/input_file_entry.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Object representing a file in an array
-type InputFileEntry struct {
- // Base64 encoded content `<= 20971520 characters`
- Base64Content *string `json:"base64Content,omitempty"`
- // Enable public access to the file
- EnablePublicUrl *bool `json:"enablePublicUrl,omitempty"`
- Id *FileItemId `json:"id,omitempty"`
- MediaType *MediaType `json:"mediaType,omitempty"`
- Name *FileName `json:"name,omitempty"`
- // Time to live for signed URLs
- SignedUrlTimeout *int `json:"signedUrlTimeout,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/insert_record_request.go b/xata/internal/fern-workspace/generated/go/insert_record_request.go
deleted file mode 100644
index 912d408..0000000
--- a/xata/internal/fern-workspace/generated/go/insert_record_request.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
-)
-
-// InsertRecordRequest is an in-lined request used by the InsertRecord endpoint.
-type InsertRecordRequest struct {
- // Column filters
- Columns []*string `json:"-"`
- Body map[string]*DataInputRecordValue `json:"-"`
-}
-
-func (i *InsertRecordRequest) UnmarshalJSON(data []byte) error {
- var body map[string]*DataInputRecordValue
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- i.Body = body
- return nil
-}
-
-func (i *InsertRecordRequest) MarshalJSON() ([]byte, error) {
- return json.Marshal(i.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/insert_record_response.go b/xata/internal/fern-workspace/generated/go/insert_record_response.go
deleted file mode 100644
index b4d7a38..0000000
--- a/xata/internal/fern-workspace/generated/go/insert_record_response.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type InsertRecordResponse struct {
- typeName string
- Record *Record
- InsertRecordResponseId *InsertRecordResponseId
-}
-
-func NewInsertRecordResponseFromRecord(value *Record) *InsertRecordResponse {
- return &InsertRecordResponse{typeName: "record", Record: value}
-}
-
-func NewInsertRecordResponseFromInsertRecordResponseId(value *InsertRecordResponseId) *InsertRecordResponse {
- return &InsertRecordResponse{typeName: "insertRecordResponseId", InsertRecordResponseId: value}
-}
-
-func (i *InsertRecordResponse) UnmarshalJSON(data []byte) error {
- valueRecord := new(Record)
- if err := json.Unmarshal(data, &valueRecord); err == nil {
- i.typeName = "record"
- i.Record = valueRecord
- return nil
- }
- valueInsertRecordResponseId := new(InsertRecordResponseId)
- if err := json.Unmarshal(data, &valueInsertRecordResponseId); err == nil {
- i.typeName = "insertRecordResponseId"
- i.InsertRecordResponseId = valueInsertRecordResponseId
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, i)
-}
-
-func (i InsertRecordResponse) MarshalJSON() ([]byte, error) {
- switch i.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", i.typeName, i)
- case "record":
- return json.Marshal(i.Record)
- case "insertRecordResponseId":
- return json.Marshal(i.InsertRecordResponseId)
- }
-}
-
-type InsertRecordResponseVisitor interface {
- VisitRecord(*Record) error
- VisitInsertRecordResponseId(*InsertRecordResponseId) error
-}
-
-func (i *InsertRecordResponse) Accept(v InsertRecordResponseVisitor) error {
- switch i.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", i.typeName, i)
- case "record":
- return v.VisitRecord(i.Record)
- case "insertRecordResponseId":
- return v.VisitInsertRecordResponseId(i.InsertRecordResponseId)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/insert_record_response_id.go b/xata/internal/fern-workspace/generated/go/insert_record_response_id.go
deleted file mode 100644
index b7fd884..0000000
--- a/xata/internal/fern-workspace/generated/go/insert_record_response_id.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type InsertRecordResponseId struct {
- Id string `json:"id"`
- Xata *InsertRecordResponseIdXata `json:"xata,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/insert_record_response_id_xata.go b/xata/internal/fern-workspace/generated/go/insert_record_response_id_xata.go
deleted file mode 100644
index e2f47b8..0000000
--- a/xata/internal/fern-workspace/generated/go/insert_record_response_id_xata.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type InsertRecordResponseIdXata struct {
- CreatedAt string `json:"createdAt"`
- UpdatedAt string `json:"updatedAt"`
- Version int `json:"version"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/insert_record_with_id_request.go b/xata/internal/fern-workspace/generated/go/insert_record_with_id_request.go
deleted file mode 100644
index 5ca5d00..0000000
--- a/xata/internal/fern-workspace/generated/go/insert_record_with_id_request.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
-)
-
-// InsertRecordWithIdRequest is an in-lined request used by the InsertRecordWithId endpoint.
-type InsertRecordWithIdRequest struct {
- CreateOnly *bool `json:"-"`
- IfVersion *int `json:"-"`
- // Column filters
- Columns []*string `json:"-"`
- Body map[string]*DataInputRecordValue `json:"-"`
-}
-
-func (i *InsertRecordWithIdRequest) UnmarshalJSON(data []byte) error {
- var body map[string]*DataInputRecordValue
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- i.Body = body
- return nil
-}
-
-func (i *InsertRecordWithIdRequest) MarshalJSON() ([]byte, error) {
- return json.Marshal(i.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/insert_record_with_id_response.go b/xata/internal/fern-workspace/generated/go/insert_record_with_id_response.go
deleted file mode 100644
index 10fe22b..0000000
--- a/xata/internal/fern-workspace/generated/go/insert_record_with_id_response.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type InsertRecordWithIdResponse struct {
- typeName string
- Record *Record
- InsertRecordWithIdResponseId *InsertRecordWithIdResponseId
-}
-
-func NewInsertRecordWithIdResponseFromRecord(value *Record) *InsertRecordWithIdResponse {
- return &InsertRecordWithIdResponse{typeName: "record", Record: value}
-}
-
-func NewInsertRecordWithIdResponseFromInsertRecordWithIdResponseId(value *InsertRecordWithIdResponseId) *InsertRecordWithIdResponse {
- return &InsertRecordWithIdResponse{typeName: "insertRecordWithIdResponseId", InsertRecordWithIdResponseId: value}
-}
-
-func (i *InsertRecordWithIdResponse) UnmarshalJSON(data []byte) error {
- valueRecord := new(Record)
- if err := json.Unmarshal(data, &valueRecord); err == nil {
- i.typeName = "record"
- i.Record = valueRecord
- return nil
- }
- valueInsertRecordWithIdResponseId := new(InsertRecordWithIdResponseId)
- if err := json.Unmarshal(data, &valueInsertRecordWithIdResponseId); err == nil {
- i.typeName = "insertRecordWithIdResponseId"
- i.InsertRecordWithIdResponseId = valueInsertRecordWithIdResponseId
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, i)
-}
-
-func (i InsertRecordWithIdResponse) MarshalJSON() ([]byte, error) {
- switch i.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", i.typeName, i)
- case "record":
- return json.Marshal(i.Record)
- case "insertRecordWithIdResponseId":
- return json.Marshal(i.InsertRecordWithIdResponseId)
- }
-}
-
-type InsertRecordWithIdResponseVisitor interface {
- VisitRecord(*Record) error
- VisitInsertRecordWithIdResponseId(*InsertRecordWithIdResponseId) error
-}
-
-func (i *InsertRecordWithIdResponse) Accept(v InsertRecordWithIdResponseVisitor) error {
- switch i.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", i.typeName, i)
- case "record":
- return v.VisitRecord(i.Record)
- case "insertRecordWithIdResponseId":
- return v.VisitInsertRecordWithIdResponseId(i.InsertRecordWithIdResponseId)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/insert_record_with_id_response_id.go b/xata/internal/fern-workspace/generated/go/insert_record_with_id_response_id.go
deleted file mode 100644
index 7000e8b..0000000
--- a/xata/internal/fern-workspace/generated/go/insert_record_with_id_response_id.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type InsertRecordWithIdResponseId struct {
- Id string `json:"id"`
- Xata *InsertRecordWithIdResponseIdXata `json:"xata,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/insert_record_with_id_response_id_xata.go b/xata/internal/fern-workspace/generated/go/insert_record_with_id_response_id_xata.go
deleted file mode 100644
index ac979df..0000000
--- a/xata/internal/fern-workspace/generated/go/insert_record_with_id_response_id_xata.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type InsertRecordWithIdResponseIdXata struct {
- CreatedAt string `json:"createdAt"`
- UpdatedAt string `json:"updatedAt"`
- Version int `json:"version"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/list_branches_response.go b/xata/internal/fern-workspace/generated/go/list_branches_response.go
deleted file mode 100644
index f37176a..0000000
--- a/xata/internal/fern-workspace/generated/go/list_branches_response.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ListBranchesResponse struct {
- Branches []*Branch `json:"branches,omitempty"`
- DatabaseName string `json:"databaseName"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/list_git_branches_response.go b/xata/internal/fern-workspace/generated/go/list_git_branches_response.go
deleted file mode 100644
index d9c7826..0000000
--- a/xata/internal/fern-workspace/generated/go/list_git_branches_response.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ListGitBranchesResponse struct {
- Mapping []*ListGitBranchesResponseMappingItem `json:"mapping,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/list_git_branches_response_mapping_item.go b/xata/internal/fern-workspace/generated/go/list_git_branches_response_mapping_item.go
deleted file mode 100644
index f838044..0000000
--- a/xata/internal/fern-workspace/generated/go/list_git_branches_response_mapping_item.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ListGitBranchesResponseMappingItem struct {
- GitBranch string `json:"gitBranch"`
- XataBranch string `json:"xataBranch"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/max_agg.go b/xata/internal/fern-workspace/generated/go/max_agg.go
deleted file mode 100644
index cca7bc0..0000000
--- a/xata/internal/fern-workspace/generated/go/max_agg.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// The max of the numeric values in a particular column.
-type MaxAgg struct {
- // The column on which to compute the max. Must be a numeric type.
- Column string `json:"column"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/media_type.go b/xata/internal/fern-workspace/generated/go/media_type.go
deleted file mode 100644
index a3cdf00..0000000
--- a/xata/internal/fern-workspace/generated/go/media_type.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Media type `<= 255 characters`
-type MediaType = string
diff --git a/xata/internal/fern-workspace/generated/go/metrics_datapoint.go b/xata/internal/fern-workspace/generated/go/metrics_datapoint.go
deleted file mode 100644
index 1b8a85b..0000000
--- a/xata/internal/fern-workspace/generated/go/metrics_datapoint.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MetricsDatapoint struct {
- Timestamp string `json:"timestamp"`
- Value int `json:"value"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/metrics_latency.go b/xata/internal/fern-workspace/generated/go/metrics_latency.go
deleted file mode 100644
index 65b09a7..0000000
--- a/xata/internal/fern-workspace/generated/go/metrics_latency.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MetricsLatency struct {
- P50 *[]*MetricsDatapoint `json:"p50,omitempty"`
- P90 *[]*MetricsDatapoint `json:"p90,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration.go b/xata/internal/fern-workspace/generated/go/migration.go
deleted file mode 100644
index ebd7f8b..0000000
--- a/xata/internal/fern-workspace/generated/go/migration.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Migration is an in-lined request used by the UpdateBranchSchema endpoint.
-type Migration struct {
- Operations []*MigrationOp `json:"operations,omitempty"`
- ParentId *string `json:"parentID,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_column_op.go b/xata/internal/fern-workspace/generated/go/migration_column_op.go
deleted file mode 100644
index 483cde2..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_column_op.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type MigrationColumnOp struct {
- typeName string
- MigrationColumnOpAddColumn *MigrationColumnOpAddColumn
- MigrationColumnOpRemoveColumn *MigrationColumnOpRemoveColumn
- MigrationColumnOpRenameColumn *MigrationColumnOpRenameColumn
-}
-
-func NewMigrationColumnOpFromMigrationColumnOpAddColumn(value *MigrationColumnOpAddColumn) *MigrationColumnOp {
- return &MigrationColumnOp{typeName: "migrationColumnOpAddColumn", MigrationColumnOpAddColumn: value}
-}
-
-func NewMigrationColumnOpFromMigrationColumnOpRemoveColumn(value *MigrationColumnOpRemoveColumn) *MigrationColumnOp {
- return &MigrationColumnOp{typeName: "migrationColumnOpRemoveColumn", MigrationColumnOpRemoveColumn: value}
-}
-
-func NewMigrationColumnOpFromMigrationColumnOpRenameColumn(value *MigrationColumnOpRenameColumn) *MigrationColumnOp {
- return &MigrationColumnOp{typeName: "migrationColumnOpRenameColumn", MigrationColumnOpRenameColumn: value}
-}
-
-func (m *MigrationColumnOp) UnmarshalJSON(data []byte) error {
- valueMigrationColumnOpAddColumn := new(MigrationColumnOpAddColumn)
- if err := json.Unmarshal(data, &valueMigrationColumnOpAddColumn); err == nil {
- m.typeName = "migrationColumnOpAddColumn"
- m.MigrationColumnOpAddColumn = valueMigrationColumnOpAddColumn
- return nil
- }
- valueMigrationColumnOpRemoveColumn := new(MigrationColumnOpRemoveColumn)
- if err := json.Unmarshal(data, &valueMigrationColumnOpRemoveColumn); err == nil {
- m.typeName = "migrationColumnOpRemoveColumn"
- m.MigrationColumnOpRemoveColumn = valueMigrationColumnOpRemoveColumn
- return nil
- }
- valueMigrationColumnOpRenameColumn := new(MigrationColumnOpRenameColumn)
- if err := json.Unmarshal(data, &valueMigrationColumnOpRenameColumn); err == nil {
- m.typeName = "migrationColumnOpRenameColumn"
- m.MigrationColumnOpRenameColumn = valueMigrationColumnOpRenameColumn
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, m)
-}
-
-func (m MigrationColumnOp) MarshalJSON() ([]byte, error) {
- switch m.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", m.typeName, m)
- case "migrationColumnOpAddColumn":
- return json.Marshal(m.MigrationColumnOpAddColumn)
- case "migrationColumnOpRemoveColumn":
- return json.Marshal(m.MigrationColumnOpRemoveColumn)
- case "migrationColumnOpRenameColumn":
- return json.Marshal(m.MigrationColumnOpRenameColumn)
- }
-}
-
-type MigrationColumnOpVisitor interface {
- VisitMigrationColumnOpAddColumn(*MigrationColumnOpAddColumn) error
- VisitMigrationColumnOpRemoveColumn(*MigrationColumnOpRemoveColumn) error
- VisitMigrationColumnOpRenameColumn(*MigrationColumnOpRenameColumn) error
-}
-
-func (m *MigrationColumnOp) Accept(v MigrationColumnOpVisitor) error {
- switch m.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", m.typeName, m)
- case "migrationColumnOpAddColumn":
- return v.VisitMigrationColumnOpAddColumn(m.MigrationColumnOpAddColumn)
- case "migrationColumnOpRemoveColumn":
- return v.VisitMigrationColumnOpRemoveColumn(m.MigrationColumnOpRemoveColumn)
- case "migrationColumnOpRenameColumn":
- return v.VisitMigrationColumnOpRenameColumn(m.MigrationColumnOpRenameColumn)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_column_op_add_column.go b/xata/internal/fern-workspace/generated/go/migration_column_op_add_column.go
deleted file mode 100644
index 4d12a86..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_column_op_add_column.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MigrationColumnOpAddColumn struct {
- AddColumn *ColumnOpAdd `json:"addColumn,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_column_op_remove_column.go b/xata/internal/fern-workspace/generated/go/migration_column_op_remove_column.go
deleted file mode 100644
index 1a8a391..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_column_op_remove_column.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MigrationColumnOpRemoveColumn struct {
- RemoveColumn *ColumnOpRemove `json:"removeColumn,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_column_op_rename_column.go b/xata/internal/fern-workspace/generated/go/migration_column_op_rename_column.go
deleted file mode 100644
index 7dcbcff..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_column_op_rename_column.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MigrationColumnOpRenameColumn struct {
- RenameColumn *ColumnOpRename `json:"renameColumn,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_object.go b/xata/internal/fern-workspace/generated/go/migration_object.go
deleted file mode 100644
index 97ef99b..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_object.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MigrationObject struct {
- Checksum string `json:"checksum"`
- Id string `json:"id"`
- Message *string `json:"message,omitempty"`
- Operations []*MigrationOp `json:"operations,omitempty"`
- ParentId *string `json:"parentID,omitempty"`
- Title *string `json:"title,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_op.go b/xata/internal/fern-workspace/generated/go/migration_op.go
deleted file mode 100644
index 54b8c2c..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_op.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-// Branch schema migration operations.
-type MigrationOp struct {
- typeName string
- MigrationTableOp *MigrationTableOp
- MigrationColumnOp *MigrationColumnOp
-}
-
-func NewMigrationOpFromMigrationTableOp(value *MigrationTableOp) *MigrationOp {
- return &MigrationOp{typeName: "migrationTableOp", MigrationTableOp: value}
-}
-
-func NewMigrationOpFromMigrationColumnOp(value *MigrationColumnOp) *MigrationOp {
- return &MigrationOp{typeName: "migrationColumnOp", MigrationColumnOp: value}
-}
-
-func (m *MigrationOp) UnmarshalJSON(data []byte) error {
- valueMigrationTableOp := new(MigrationTableOp)
- if err := json.Unmarshal(data, &valueMigrationTableOp); err == nil {
- m.typeName = "migrationTableOp"
- m.MigrationTableOp = valueMigrationTableOp
- return nil
- }
- valueMigrationColumnOp := new(MigrationColumnOp)
- if err := json.Unmarshal(data, &valueMigrationColumnOp); err == nil {
- m.typeName = "migrationColumnOp"
- m.MigrationColumnOp = valueMigrationColumnOp
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, m)
-}
-
-func (m MigrationOp) MarshalJSON() ([]byte, error) {
- switch m.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", m.typeName, m)
- case "migrationTableOp":
- return json.Marshal(m.MigrationTableOp)
- case "migrationColumnOp":
- return json.Marshal(m.MigrationColumnOp)
- }
-}
-
-type MigrationOpVisitor interface {
- VisitMigrationTableOp(*MigrationTableOp) error
- VisitMigrationColumnOp(*MigrationColumnOp) error
-}
-
-func (m *MigrationOp) Accept(v MigrationOpVisitor) error {
- switch m.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", m.typeName, m)
- case "migrationTableOp":
- return v.VisitMigrationTableOp(m.MigrationTableOp)
- case "migrationColumnOp":
- return v.VisitMigrationColumnOp(m.MigrationColumnOp)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_request.go b/xata/internal/fern-workspace/generated/go/migration_request.go
deleted file mode 100644
index b12d8b9..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_request.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MigrationRequest struct {
- // The migration request body with detailed description.
- Body *string `json:"body,omitempty"`
- ClosedAt *DateTime `json:"closedAt,omitempty"`
- CreatedAt *DateTime `json:"createdAt,omitempty"`
- MergedAt *DateTime `json:"mergedAt,omitempty"`
- ModifiedAt *DateTime `json:"modifiedAt,omitempty"`
- Number *MigrationRequestNumber `json:"number,omitempty"`
- // Name of the source branch.
- Source *string `json:"source,omitempty"`
- Status *MigrationRequestStatus `json:"status,omitempty"`
- // Name of the target branch.
- Target *string `json:"target,omitempty"`
- // The migration request title.
- Title *string `json:"title,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_request_number.go b/xata/internal/fern-workspace/generated/go/migration_request_number.go
deleted file mode 100644
index 1e1d1ff..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_request_number.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// The migration request number.
-type MigrationRequestNumber = int
diff --git a/xata/internal/fern-workspace/generated/go/migration_request_status.go b/xata/internal/fern-workspace/generated/go/migration_request_status.go
deleted file mode 100644
index 507becc..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_request_status.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-type MigrationRequestStatus uint8
-
-const (
- MigrationRequestStatusOpen MigrationRequestStatus = iota + 1
- MigrationRequestStatusClosed
- MigrationRequestStatusMerging
- MigrationRequestStatusMerged
- MigrationRequestStatusFailed
-)
-
-func (m MigrationRequestStatus) String() string {
- switch m {
- default:
- return strconv.Itoa(int(m))
- case MigrationRequestStatusOpen:
- return "open"
- case MigrationRequestStatusClosed:
- return "closed"
- case MigrationRequestStatusMerging:
- return "merging"
- case MigrationRequestStatusMerged:
- return "merged"
- case MigrationRequestStatusFailed:
- return "failed"
- }
-}
-
-func (m MigrationRequestStatus) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", m.String())), nil
-}
-
-func (m *MigrationRequestStatus) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "open":
- value := MigrationRequestStatusOpen
- *m = value
- case "closed":
- value := MigrationRequestStatusClosed
- *m = value
- case "merging":
- value := MigrationRequestStatusMerging
- *m = value
- case "merged":
- value := MigrationRequestStatusMerged
- *m = value
- case "failed":
- value := MigrationRequestStatusFailed
- *m = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_status.go b/xata/internal/fern-workspace/generated/go/migration_status.go
deleted file mode 100644
index 4f0ef17..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_status.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-type MigrationStatus uint8
-
-const (
- MigrationStatusCompleted MigrationStatus = iota + 1
- MigrationStatusPending
- MigrationStatusFailed
-)
-
-func (m MigrationStatus) String() string {
- switch m {
- default:
- return strconv.Itoa(int(m))
- case MigrationStatusCompleted:
- return "completed"
- case MigrationStatusPending:
- return "pending"
- case MigrationStatusFailed:
- return "failed"
- }
-}
-
-func (m MigrationStatus) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", m.String())), nil
-}
-
-func (m *MigrationStatus) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "completed":
- value := MigrationStatusCompleted
- *m = value
- case "pending":
- value := MigrationStatusPending
- *m = value
- case "failed":
- value := MigrationStatusFailed
- *m = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_table_op.go b/xata/internal/fern-workspace/generated/go/migration_table_op.go
deleted file mode 100644
index 3980d91..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_table_op.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type MigrationTableOp struct {
- typeName string
- MigrationTableOpAddTable *MigrationTableOpAddTable
- MigrationTableOpRemoveTable *MigrationTableOpRemoveTable
- MigrationTableOpRenameTable *MigrationTableOpRenameTable
-}
-
-func NewMigrationTableOpFromMigrationTableOpAddTable(value *MigrationTableOpAddTable) *MigrationTableOp {
- return &MigrationTableOp{typeName: "migrationTableOpAddTable", MigrationTableOpAddTable: value}
-}
-
-func NewMigrationTableOpFromMigrationTableOpRemoveTable(value *MigrationTableOpRemoveTable) *MigrationTableOp {
- return &MigrationTableOp{typeName: "migrationTableOpRemoveTable", MigrationTableOpRemoveTable: value}
-}
-
-func NewMigrationTableOpFromMigrationTableOpRenameTable(value *MigrationTableOpRenameTable) *MigrationTableOp {
- return &MigrationTableOp{typeName: "migrationTableOpRenameTable", MigrationTableOpRenameTable: value}
-}
-
-func (m *MigrationTableOp) UnmarshalJSON(data []byte) error {
- valueMigrationTableOpAddTable := new(MigrationTableOpAddTable)
- if err := json.Unmarshal(data, &valueMigrationTableOpAddTable); err == nil {
- m.typeName = "migrationTableOpAddTable"
- m.MigrationTableOpAddTable = valueMigrationTableOpAddTable
- return nil
- }
- valueMigrationTableOpRemoveTable := new(MigrationTableOpRemoveTable)
- if err := json.Unmarshal(data, &valueMigrationTableOpRemoveTable); err == nil {
- m.typeName = "migrationTableOpRemoveTable"
- m.MigrationTableOpRemoveTable = valueMigrationTableOpRemoveTable
- return nil
- }
- valueMigrationTableOpRenameTable := new(MigrationTableOpRenameTable)
- if err := json.Unmarshal(data, &valueMigrationTableOpRenameTable); err == nil {
- m.typeName = "migrationTableOpRenameTable"
- m.MigrationTableOpRenameTable = valueMigrationTableOpRenameTable
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, m)
-}
-
-func (m MigrationTableOp) MarshalJSON() ([]byte, error) {
- switch m.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", m.typeName, m)
- case "migrationTableOpAddTable":
- return json.Marshal(m.MigrationTableOpAddTable)
- case "migrationTableOpRemoveTable":
- return json.Marshal(m.MigrationTableOpRemoveTable)
- case "migrationTableOpRenameTable":
- return json.Marshal(m.MigrationTableOpRenameTable)
- }
-}
-
-type MigrationTableOpVisitor interface {
- VisitMigrationTableOpAddTable(*MigrationTableOpAddTable) error
- VisitMigrationTableOpRemoveTable(*MigrationTableOpRemoveTable) error
- VisitMigrationTableOpRenameTable(*MigrationTableOpRenameTable) error
-}
-
-func (m *MigrationTableOp) Accept(v MigrationTableOpVisitor) error {
- switch m.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", m.typeName, m)
- case "migrationTableOpAddTable":
- return v.VisitMigrationTableOpAddTable(m.MigrationTableOpAddTable)
- case "migrationTableOpRemoveTable":
- return v.VisitMigrationTableOpRemoveTable(m.MigrationTableOpRemoveTable)
- case "migrationTableOpRenameTable":
- return v.VisitMigrationTableOpRenameTable(m.MigrationTableOpRenameTable)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_table_op_add_table.go b/xata/internal/fern-workspace/generated/go/migration_table_op_add_table.go
deleted file mode 100644
index 72df288..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_table_op_add_table.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MigrationTableOpAddTable struct {
- AddTable *TableOpAdd `json:"addTable,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_table_op_remove_table.go b/xata/internal/fern-workspace/generated/go/migration_table_op_remove_table.go
deleted file mode 100644
index c8cd3ef..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_table_op_remove_table.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MigrationTableOpRemoveTable struct {
- RemoveTable *TableOpRemove `json:"removeTable,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migration_table_op_rename_table.go b/xata/internal/fern-workspace/generated/go/migration_table_op_rename_table.go
deleted file mode 100644
index bdaeba0..0000000
--- a/xata/internal/fern-workspace/generated/go/migration_table_op_rename_table.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type MigrationTableOpRenameTable struct {
- RenameTable *TableOpRename `json:"renameTable,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/migrations_client.go b/xata/internal/fern-workspace/generated/go/migrations_client.go
deleted file mode 100644
index d0e1472..0000000
--- a/xata/internal/fern-workspace/generated/go/migrations_client.go
+++ /dev/null
@@ -1,461 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- bytes "bytes"
- context "context"
- json "encoding/json"
- errors "errors"
- fmt "fmt"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
- io "io"
- http "net/http"
-)
-
-type MigrationsClient interface {
- ApplyBranchSchemaEdit(ctx context.Context, dbBranchName DbBranchName, request *ApplyBranchSchemaEditRequest) (*ApplyBranchSchemaEditResponse, error)
- CompareBranchWithUserSchema(ctx context.Context, dbBranchName DbBranchName, request *CompareBranchWithUserSchemaRequest) (*CompareBranchWithUserSchemaResponse, error)
- CompareBranchSchemas(ctx context.Context, dbBranchName DbBranchName, branchName BranchName, request *CompareBranchSchemasRequest) (*CompareBranchSchemasResponse, error)
- GetBranchSchemaHistory(ctx context.Context, dbBranchName DbBranchName, request *GetBranchSchemaHistoryRequest) (*GetBranchSchemaHistoryResponse, error)
- PreviewBranchSchemaEdit(ctx context.Context, dbBranchName DbBranchName, request *PreviewBranchSchemaEditRequest) (*PreviewBranchSchemaEditResponse, error)
- PushBranchMigrations(ctx context.Context, dbBranchName DbBranchName, request *PushBranchMigrationsRequest) (*PushBranchMigrationsResponse, error)
- UpdateBranchSchema(ctx context.Context, dbBranchName DbBranchName, request *Migration) (*UpdateBranchSchemaResponse, error)
-}
-
-func NewMigrationsClient(opts ...core.ClientOption) MigrationsClient {
- options := core.NewClientOptions()
- for _, opt := range opts {
- opt(options)
- }
- return &migrationsClient{
- baseURL: options.BaseURL,
- httpClient: options.HTTPClient,
- header: options.ToHeader(),
- }
-}
-
-type migrationsClient struct {
- baseURL string
- httpClient core.HTTPClient
- header http.Header
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (m *migrationsClient) ApplyBranchSchemaEdit(ctx context.Context, dbBranchName DbBranchName, request *ApplyBranchSchemaEditRequest) (*ApplyBranchSchemaEditResponse, error) {
- baseURL := "/"
- if m.baseURL != "" {
- baseURL = m.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/schema/apply", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *ApplyBranchSchemaEditResponse
- if err := core.DoRequest(
- ctx,
- m.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- m.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (m *migrationsClient) CompareBranchWithUserSchema(ctx context.Context, dbBranchName DbBranchName, request *CompareBranchWithUserSchemaRequest) (*CompareBranchWithUserSchemaResponse, error) {
- baseURL := "/"
- if m.baseURL != "" {
- baseURL = m.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/schema/compare", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *CompareBranchWithUserSchemaResponse
- if err := core.DoRequest(
- ctx,
- m.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- m.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Database Name
-func (m *migrationsClient) CompareBranchSchemas(ctx context.Context, dbBranchName DbBranchName, branchName BranchName, request *CompareBranchSchemasRequest) (*CompareBranchSchemasResponse, error) {
- baseURL := "/"
- if m.baseURL != "" {
- baseURL = m.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/schema/compare/%v", dbBranchName, branchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *CompareBranchSchemasResponse
- if err := core.DoRequest(
- ctx,
- m.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- m.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (m *migrationsClient) GetBranchSchemaHistory(ctx context.Context, dbBranchName DbBranchName, request *GetBranchSchemaHistoryRequest) (*GetBranchSchemaHistoryResponse, error) {
- baseURL := "/"
- if m.baseURL != "" {
- baseURL = m.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/schema/history", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *GetBranchSchemaHistoryResponse
- if err := core.DoRequest(
- ctx,
- m.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- m.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (m *migrationsClient) PreviewBranchSchemaEdit(ctx context.Context, dbBranchName DbBranchName, request *PreviewBranchSchemaEditRequest) (*PreviewBranchSchemaEditResponse, error) {
- baseURL := "/"
- if m.baseURL != "" {
- baseURL = m.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/schema/preview", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *PreviewBranchSchemaEditResponse
- if err := core.DoRequest(
- ctx,
- m.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- m.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The `schema/push` API accepts a list of migrations to be applied to the
-// current branch. A list of applicable migrations can be fetched using
-// the `schema/history` API from another branch or database.
-//
-// The most recent migration must be part of the list or referenced (via
-// `parentID`) by the first migration in the list of migrations to be pushed.
-//
-// Each migration in the list has an `id`, `parentID`, and `checksum`. The
-// checksum for migrations are generated and verified by xata. The
-// operation fails if any migration in the list has an invalid checksum.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (m *migrationsClient) PushBranchMigrations(ctx context.Context, dbBranchName DbBranchName, request *PushBranchMigrationsRequest) (*PushBranchMigrationsResponse, error) {
- baseURL := "/"
- if m.baseURL != "" {
- baseURL = m.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/schema/push", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *PushBranchMigrationsResponse
- if err := core.DoRequest(
- ctx,
- m.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- m.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (m *migrationsClient) UpdateBranchSchema(ctx context.Context, dbBranchName DbBranchName, request *Migration) (*UpdateBranchSchemaResponse, error) {
- baseURL := "/"
- if m.baseURL != "" {
- baseURL = m.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/schema/update", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *UpdateBranchSchemaResponse
- if err := core.DoRequest(
- ctx,
- m.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- m.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/min_agg.go b/xata/internal/fern-workspace/generated/go/min_agg.go
deleted file mode 100644
index b8d2691..0000000
--- a/xata/internal/fern-workspace/generated/go/min_agg.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// The min of the numeric values in a particular column.
-type MinAgg struct {
- // The column on which to compute the min. Must be a numeric type.
- Column string `json:"column"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/not_found_error.go b/xata/internal/fern-workspace/generated/go/not_found_error.go
deleted file mode 100644
index 53bb40a..0000000
--- a/xata/internal/fern-workspace/generated/go/not_found_error.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
-)
-
-type NotFoundError struct {
- *core.APIError
- Body any
-}
-
-func (n *NotFoundError) UnmarshalJSON(data []byte) error {
- var body any
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- n.StatusCode = 404
- n.Body = body
- return nil
-}
-
-func (n *NotFoundError) MarshalJSON() ([]byte, error) {
- return json.Marshal(n.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/numeric_booster.go b/xata/internal/fern-workspace/generated/go/numeric_booster.go
deleted file mode 100644
index a837a16..0000000
--- a/xata/internal/fern-workspace/generated/go/numeric_booster.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Boost records based on the value of a numeric column.
-type NumericBooster struct {
- // The column in which to look for the value.
- Column string `json:"column"`
- // The factor with which to multiply the value of the column before adding it to the item score.
- Factor float64 `json:"factor"`
- IfMatchesFilter *FilterExpression `json:"ifMatchesFilter,omitempty"`
- // Modifier to be applied to the column value, before being multiplied with the factor. The possible values are:
- // - none (default).
- // - log: common logarithm (base 10)
- // - log1p: add 1 then take the common logarithm. This ensures that the value is positive if the
- // value is between 0 and 1.
- // - ln: natural logarithm (base e)
- // - ln1p: add 1 then take the natural logarithm. This ensures that the value is positive if the
- // value is between 0 and 1.
- // - square: raise the value to the power of two.
- // - sqrt: take the square root of the value.
- // - reciprocal: reciprocate the value (if the value is `x`, the reciprocal is `1/x`).
- Modifier *NumericBoosterModifier `json:"modifier,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/numeric_booster_modifier.go b/xata/internal/fern-workspace/generated/go/numeric_booster_modifier.go
deleted file mode 100644
index 8ba9e96..0000000
--- a/xata/internal/fern-workspace/generated/go/numeric_booster_modifier.go
+++ /dev/null
@@ -1,94 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-// Modifier to be applied to the column value, before being multiplied with the factor. The possible values are:
-// - none (default).
-// - log: common logarithm (base 10)
-// - log1p: add 1 then take the common logarithm. This ensures that the value is positive if the
-// value is between 0 and 1.
-// - ln: natural logarithm (base e)
-// - ln1p: add 1 then take the natural logarithm. This ensures that the value is positive if the
-// value is between 0 and 1.
-// - square: raise the value to the power of two.
-// - sqrt: take the square root of the value.
-// - reciprocal: reciprocate the value (if the value is `x`, the reciprocal is `1/x`).
-type NumericBoosterModifier uint8
-
-const (
- NumericBoosterModifierNone NumericBoosterModifier = iota + 1
- NumericBoosterModifierLog
- NumericBoosterModifierLog1P
- NumericBoosterModifierLn
- NumericBoosterModifierLn1P
- NumericBoosterModifierSquare
- NumericBoosterModifierSqrt
- NumericBoosterModifierReciprocal
-)
-
-func (n NumericBoosterModifier) String() string {
- switch n {
- default:
- return strconv.Itoa(int(n))
- case NumericBoosterModifierNone:
- return "none"
- case NumericBoosterModifierLog:
- return "log"
- case NumericBoosterModifierLog1P:
- return "log1p"
- case NumericBoosterModifierLn:
- return "ln"
- case NumericBoosterModifierLn1P:
- return "ln1p"
- case NumericBoosterModifierSquare:
- return "square"
- case NumericBoosterModifierSqrt:
- return "sqrt"
- case NumericBoosterModifierReciprocal:
- return "reciprocal"
- }
-}
-
-func (n NumericBoosterModifier) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", n.String())), nil
-}
-
-func (n *NumericBoosterModifier) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "none":
- value := NumericBoosterModifierNone
- *n = value
- case "log":
- value := NumericBoosterModifierLog
- *n = value
- case "log1p":
- value := NumericBoosterModifierLog1P
- *n = value
- case "ln":
- value := NumericBoosterModifierLn
- *n = value
- case "ln1p":
- value := NumericBoosterModifierLn1P
- *n = value
- case "square":
- value := NumericBoosterModifierSquare
- *n = value
- case "sqrt":
- value := NumericBoosterModifierSqrt
- *n = value
- case "reciprocal":
- value := NumericBoosterModifierReciprocal
- *n = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/numeric_histogram_agg.go b/xata/internal/fern-workspace/generated/go/numeric_histogram_agg.go
deleted file mode 100644
index eac140a..0000000
--- a/xata/internal/fern-workspace/generated/go/numeric_histogram_agg.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Split data into buckets by dynamic numeric ranges. Accepts sub-aggregations for each bucket.
-type NumericHistogramAgg struct {
- Aggs *AggExpressionMap `json:"aggs,omitempty"`
- // The column to use for bucketing. Must be of numeric type.
- Column string `json:"column"`
- // The numeric interval to use for bucketing. The resulting buckets will be ranges
- // with this value as size.
- Interval float64 `json:"interval"`
- // By default the bucket keys start with 0 and then continue in `interval` steps. The bucket
- // boundaries can be shifted by using the offset option. For example, if the `interval` is 100,
- // but you prefer the bucket boundaries to be `[50, 150), [150, 250), etc.`, you can set `offset`
- // to 50.
- Offset *float64 `json:"offset,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/object_value.go b/xata/internal/fern-workspace/generated/go/object_value.go
deleted file mode 100644
index e964abd..0000000
--- a/xata/internal/fern-workspace/generated/go/object_value.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Object column value
-type ObjectValue = map[string]*ObjectValueValue
diff --git a/xata/internal/fern-workspace/generated/go/object_value_value.go b/xata/internal/fern-workspace/generated/go/object_value_value.go
deleted file mode 100644
index 6046970..0000000
--- a/xata/internal/fern-workspace/generated/go/object_value_value.go
+++ /dev/null
@@ -1,145 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type ObjectValueValue struct {
- typeName string
- String string
- Boolean bool
- Double float64
- StringList []string
- DoubleList []float64
- DateTime DateTime
- ObjectValue ObjectValue
-}
-
-func NewObjectValueValueFromString(value string) *ObjectValueValue {
- return &ObjectValueValue{typeName: "string", String: value}
-}
-
-func NewObjectValueValueFromBoolean(value bool) *ObjectValueValue {
- return &ObjectValueValue{typeName: "boolean", Boolean: value}
-}
-
-func NewObjectValueValueFromDouble(value float64) *ObjectValueValue {
- return &ObjectValueValue{typeName: "double", Double: value}
-}
-
-func NewObjectValueValueFromStringList(value []string) *ObjectValueValue {
- return &ObjectValueValue{typeName: "stringList", StringList: value}
-}
-
-func NewObjectValueValueFromDoubleList(value []float64) *ObjectValueValue {
- return &ObjectValueValue{typeName: "doubleList", DoubleList: value}
-}
-
-func NewObjectValueValueFromDateTime(value DateTime) *ObjectValueValue {
- return &ObjectValueValue{typeName: "dateTime", DateTime: value}
-}
-
-func NewObjectValueValueFromObjectValue(value ObjectValue) *ObjectValueValue {
- return &ObjectValueValue{typeName: "objectValue", ObjectValue: value}
-}
-
-func (o *ObjectValueValue) UnmarshalJSON(data []byte) error {
- var valueString string
- if err := json.Unmarshal(data, &valueString); err == nil {
- o.typeName = "string"
- o.String = valueString
- return nil
- }
- var valueBoolean bool
- if err := json.Unmarshal(data, &valueBoolean); err == nil {
- o.typeName = "boolean"
- o.Boolean = valueBoolean
- return nil
- }
- var valueDouble float64
- if err := json.Unmarshal(data, &valueDouble); err == nil {
- o.typeName = "double"
- o.Double = valueDouble
- return nil
- }
- var valueStringList []string
- if err := json.Unmarshal(data, &valueStringList); err == nil {
- o.typeName = "stringList"
- o.StringList = valueStringList
- return nil
- }
- var valueDoubleList []float64
- if err := json.Unmarshal(data, &valueDoubleList); err == nil {
- o.typeName = "doubleList"
- o.DoubleList = valueDoubleList
- return nil
- }
- var valueDateTime DateTime
- if err := json.Unmarshal(data, &valueDateTime); err == nil {
- o.typeName = "dateTime"
- o.DateTime = valueDateTime
- return nil
- }
- var valueObjectValue ObjectValue
- if err := json.Unmarshal(data, &valueObjectValue); err == nil {
- o.typeName = "objectValue"
- o.ObjectValue = valueObjectValue
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, o)
-}
-
-func (o ObjectValueValue) MarshalJSON() ([]byte, error) {
- switch o.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", o.typeName, o)
- case "string":
- return json.Marshal(o.String)
- case "boolean":
- return json.Marshal(o.Boolean)
- case "double":
- return json.Marshal(o.Double)
- case "stringList":
- return json.Marshal(o.StringList)
- case "doubleList":
- return json.Marshal(o.DoubleList)
- case "dateTime":
- return json.Marshal(o.DateTime)
- case "objectValue":
- return json.Marshal(o.ObjectValue)
- }
-}
-
-type ObjectValueValueVisitor interface {
- VisitString(string) error
- VisitBoolean(bool) error
- VisitDouble(float64) error
- VisitStringList([]string) error
- VisitDoubleList([]float64) error
- VisitDateTime(DateTime) error
- VisitObjectValue(ObjectValue) error
-}
-
-func (o *ObjectValueValue) Accept(v ObjectValueValueVisitor) error {
- switch o.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", o.typeName, o)
- case "string":
- return v.VisitString(o.String)
- case "boolean":
- return v.VisitBoolean(o.Boolean)
- case "double":
- return v.VisitDouble(o.Double)
- case "stringList":
- return v.VisitStringList(o.StringList)
- case "doubleList":
- return v.VisitDoubleList(o.DoubleList)
- case "dateTime":
- return v.VisitDateTime(o.DateTime)
- case "objectValue":
- return v.VisitObjectValue(o.ObjectValue)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/page_config.go b/xata/internal/fern-workspace/generated/go/page_config.go
deleted file mode 100644
index ab25f4f..0000000
--- a/xata/internal/fern-workspace/generated/go/page_config.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Pagination settings.
-type PageConfig struct {
- // Query the next page that follow the cursor.
- After *string `json:"after,omitempty"`
- // Query the previous page before the cursor.
- Before *string `json:"before,omitempty"`
- // Query the last page from the cursor.
- End *string `json:"end,omitempty"`
- // Use offset to skip entries. To skip pages set offset to a multiple of size.
- Offset *int `json:"offset,omitempty"`
- // Set page size. If the size is missing it is read from the cursor. If no cursor is given Xata will choose the default page size.
- Size *int `json:"size,omitempty"`
- // Query the first page from the cursor.
- Start *string `json:"start,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/pointer.go b/xata/internal/fern-workspace/generated/go/pointer.go
deleted file mode 100644
index 82fb917..0000000
--- a/xata/internal/fern-workspace/generated/go/pointer.go
+++ /dev/null
@@ -1,103 +0,0 @@
-package api
-
-import "time"
-
-// Bool returns a pointer to the given bool value.
-func Bool(b bool) *bool {
- return &b
-}
-
-// Byte returns a pointer to the given byte value.
-func Byte(b byte) *byte {
- return &b
-}
-
-// Complex64 returns a pointer to the given complex64 value.
-func Complex64(c complex64) *complex64 {
- return &c
-}
-
-// Complex128 returns a pointer to the given complex128 value.
-func Complex128(c complex128) *complex128 {
- return &c
-}
-
-// Float32 returns a pointer to the given float32 value.
-func Float32(f float32) *float32 {
- return &f
-}
-
-// Float64 returns a pointer to the given float64 value.
-func Float64(f float64) *float64 {
- return &f
-}
-
-// Int returns a pointer to the given int value.
-func Int(i int) *int {
- return &i
-}
-
-// Int8 returns a pointer to the given int8 value.
-func Int8(i int8) *int8 {
- return &i
-}
-
-// Int16 returns a pointer to the given int16 value.
-func Int16(i int16) *int16 {
- return &i
-}
-
-// Int32 returns a pointer to the given int32 value.
-func Int32(i int32) *int32 {
- return &i
-}
-
-// Int64 returns a pointer to the given int64 value.
-func Int64(i int64) *int64 {
- return &i
-}
-
-// Rune returns a pointer to the given rune value.
-func Rune(r rune) *rune {
- return &r
-}
-
-// String returns a pointer to the given string value.
-func String(s string) *string {
- return &s
-}
-
-// Uint returns a pointer to the given uint value.
-func Uint(u uint) *uint {
- return &u
-}
-
-// Uint8 returns a pointer to the given uint8 value.
-func Uint8(u uint8) *uint8 {
- return &u
-}
-
-// Uint16 returns a pointer to the given uint16 value.
-func Uint16(u uint16) *uint16 {
- return &u
-}
-
-// Uint32 returns a pointer to the given uint32 value.
-func Uint32(u uint32) *uint32 {
- return &u
-}
-
-// Uint64 returns a pointer to the given uint64 value.
-func Uint64(u uint64) *uint64 {
- return &u
-}
-
-// Uintptr returns a pointer to the given uintptr value.
-func Uintptr(u uintptr) *uintptr {
- return &u
-}
-
-// Time returns a pointer to the given time.Time value.
-func Time(t time.Time) *time.Time {
- return &t
-}
diff --git a/xata/internal/fern-workspace/generated/go/prefix_expression.go b/xata/internal/fern-workspace/generated/go/prefix_expression.go
deleted file mode 100644
index 2eccf6a..0000000
--- a/xata/internal/fern-workspace/generated/go/prefix_expression.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-// If the prefix type is set to "disabled" (the default), the search only matches full words. If the prefix type is set to "phrase", the search will return results that match prefixes of the search phrase.
-type PrefixExpression uint8
-
-const (
- PrefixExpressionPhrase PrefixExpression = iota + 1
- PrefixExpressionDisabled
-)
-
-func (p PrefixExpression) String() string {
- switch p {
- default:
- return strconv.Itoa(int(p))
- case PrefixExpressionPhrase:
- return "phrase"
- case PrefixExpressionDisabled:
- return "disabled"
- }
-}
-
-func (p PrefixExpression) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", p.String())), nil
-}
-
-func (p *PrefixExpression) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "phrase":
- value := PrefixExpressionPhrase
- *p = value
- case "disabled":
- value := PrefixExpressionDisabled
- *p = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/preview_branch_schema_edit_request.go b/xata/internal/fern-workspace/generated/go/preview_branch_schema_edit_request.go
deleted file mode 100644
index 8325caa..0000000
--- a/xata/internal/fern-workspace/generated/go/preview_branch_schema_edit_request.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// PreviewBranchSchemaEditRequest is an in-lined request used by the PreviewBranchSchemaEdit endpoint.
-type PreviewBranchSchemaEditRequest struct {
- Edits *SchemaEditScript `json:"edits,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/preview_branch_schema_edit_response.go b/xata/internal/fern-workspace/generated/go/preview_branch_schema_edit_response.go
deleted file mode 100644
index ec3fd71..0000000
--- a/xata/internal/fern-workspace/generated/go/preview_branch_schema_edit_response.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type PreviewBranchSchemaEditResponse struct {
- Original *Schema `json:"original,omitempty"`
- Updated *Schema `json:"updated,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/projection_config.go b/xata/internal/fern-workspace/generated/go/projection_config.go
deleted file mode 100644
index 173ed8a..0000000
--- a/xata/internal/fern-workspace/generated/go/projection_config.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// A structured projection that allows for some configuration.
-type ProjectionConfig struct {
- // An alias for the projected field, this is how it will be returned in the response.
- As *string `json:"as,omitempty"`
- Columns *QueryColumnsProjection `json:"columns,omitempty"`
- Limit *int `json:"limit,omitempty"`
- // The name of the column to project or a reverse link specification, see [API Guide](https://xata.io/docs/concepts/data-model#links-and-relations).
- Name *string `json:"name,omitempty"`
- Offset *int `json:"offset,omitempty"`
- Sort *SortExpression `json:"sort,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/push_branch_migrations_request.go b/xata/internal/fern-workspace/generated/go/push_branch_migrations_request.go
deleted file mode 100644
index f46c1e1..0000000
--- a/xata/internal/fern-workspace/generated/go/push_branch_migrations_request.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// PushBranchMigrationsRequest is an in-lined request used by the PushBranchMigrations endpoint.
-type PushBranchMigrationsRequest struct {
- Migrations []*MigrationObject `json:"migrations,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/push_branch_migrations_response.go b/xata/internal/fern-workspace/generated/go/push_branch_migrations_response.go
deleted file mode 100644
index b7b9ef4..0000000
--- a/xata/internal/fern-workspace/generated/go/push_branch_migrations_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type PushBranchMigrationsResponse struct {
- // `non-empty`
- MigrationId string `json:"migrationID"`
- ParentMigrationId string `json:"parentMigrationID"`
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/query_columns_projection.go b/xata/internal/fern-workspace/generated/go/query_columns_projection.go
deleted file mode 100644
index 973103b..0000000
--- a/xata/internal/fern-workspace/generated/go/query_columns_projection.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type QueryColumnsProjection = []*QueryColumnsProjectionItem
diff --git a/xata/internal/fern-workspace/generated/go/query_columns_projection_item.go b/xata/internal/fern-workspace/generated/go/query_columns_projection_item.go
deleted file mode 100644
index f9eb760..0000000
--- a/xata/internal/fern-workspace/generated/go/query_columns_projection_item.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type QueryColumnsProjectionItem struct {
- typeName string
- String string
- ProjectionConfig *ProjectionConfig
-}
-
-func NewQueryColumnsProjectionItemFromString(value string) *QueryColumnsProjectionItem {
- return &QueryColumnsProjectionItem{typeName: "string", String: value}
-}
-
-func NewQueryColumnsProjectionItemFromProjectionConfig(value *ProjectionConfig) *QueryColumnsProjectionItem {
- return &QueryColumnsProjectionItem{typeName: "projectionConfig", ProjectionConfig: value}
-}
-
-func (q *QueryColumnsProjectionItem) UnmarshalJSON(data []byte) error {
- var valueString string
- if err := json.Unmarshal(data, &valueString); err == nil {
- q.typeName = "string"
- q.String = valueString
- return nil
- }
- valueProjectionConfig := new(ProjectionConfig)
- if err := json.Unmarshal(data, &valueProjectionConfig); err == nil {
- q.typeName = "projectionConfig"
- q.ProjectionConfig = valueProjectionConfig
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, q)
-}
-
-func (q QueryColumnsProjectionItem) MarshalJSON() ([]byte, error) {
- switch q.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", q.typeName, q)
- case "string":
- return json.Marshal(q.String)
- case "projectionConfig":
- return json.Marshal(q.ProjectionConfig)
- }
-}
-
-type QueryColumnsProjectionItemVisitor interface {
- VisitString(string) error
- VisitProjectionConfig(*ProjectionConfig) error
-}
-
-func (q *QueryColumnsProjectionItem) Accept(v QueryColumnsProjectionItemVisitor) error {
- switch q.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", q.typeName, q)
- case "string":
- return v.VisitString(q.String)
- case "projectionConfig":
- return v.VisitProjectionConfig(q.ProjectionConfig)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/query_table_request.go b/xata/internal/fern-workspace/generated/go/query_table_request.go
deleted file mode 100644
index 7d82bb6..0000000
--- a/xata/internal/fern-workspace/generated/go/query_table_request.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// QueryTableRequest is an in-lined request used by the QueryTable endpoint.
-type QueryTableRequest struct {
- Columns *QueryColumnsProjection `json:"columns,omitempty"`
- // The consistency level for this request.
- Consistency *QueryTableRequestConsistency `json:"consistency,omitempty"`
- Filter *FilterExpression `json:"filter,omitempty"`
- Page *PageConfig `json:"page,omitempty"`
- Sort *SortExpression `json:"sort,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/query_table_request_consistency.go b/xata/internal/fern-workspace/generated/go/query_table_request_consistency.go
deleted file mode 100644
index 69d6bd1..0000000
--- a/xata/internal/fern-workspace/generated/go/query_table_request_consistency.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-// The consistency level for this request.
-type QueryTableRequestConsistency uint8
-
-const (
- QueryTableRequestConsistencyStrong QueryTableRequestConsistency = iota + 1
- QueryTableRequestConsistencyEventual
-)
-
-func (q QueryTableRequestConsistency) String() string {
- switch q {
- default:
- return strconv.Itoa(int(q))
- case QueryTableRequestConsistencyStrong:
- return "strong"
- case QueryTableRequestConsistencyEventual:
- return "eventual"
- }
-}
-
-func (q QueryTableRequestConsistency) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", q.String())), nil
-}
-
-func (q *QueryTableRequestConsistency) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "strong":
- value := QueryTableRequestConsistencyStrong
- *q = value
- case "eventual":
- value := QueryTableRequestConsistencyEventual
- *q = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/query_table_response.go b/xata/internal/fern-workspace/generated/go/query_table_response.go
deleted file mode 100644
index 6ba074e..0000000
--- a/xata/internal/fern-workspace/generated/go/query_table_response.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type QueryTableResponse struct {
- Meta *RecordsMetadata `json:"meta,omitempty"`
- Records []*Record `json:"records,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/record.go b/xata/internal/fern-workspace/generated/go/record.go
deleted file mode 100644
index 79329a2..0000000
--- a/xata/internal/fern-workspace/generated/go/record.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Xata Table Record
-type Record struct {
- Id RecordId `json:"id"`
- Xata *RecordMetaXata `json:"xata,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/record_id.go b/xata/internal/fern-workspace/generated/go/record_id.go
deleted file mode 100644
index 7e6356b..0000000
--- a/xata/internal/fern-workspace/generated/go/record_id.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// `non-empty` `<= 255 characters`
-type RecordId = string
diff --git a/xata/internal/fern-workspace/generated/go/record_meta.go b/xata/internal/fern-workspace/generated/go/record_meta.go
deleted file mode 100644
index 87a716d..0000000
--- a/xata/internal/fern-workspace/generated/go/record_meta.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Xata Table Record Metadata
-type RecordMeta struct {
- Id RecordId `json:"id"`
- Xata *RecordMetaXata `json:"xata,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/record_meta_xata.go b/xata/internal/fern-workspace/generated/go/record_meta_xata.go
deleted file mode 100644
index e83b55d..0000000
--- a/xata/internal/fern-workspace/generated/go/record_meta_xata.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type RecordMetaXata struct {
- // The time when the record was created.
- CreatedAt *string `json:"createdAt,omitempty"`
- // Highlights of the record. This is used by the search APIs to indicate which fields and parts of the fields have matched the search.
- Highlight *map[string]*RecordMetaXataHighlightValue `json:"highlight,omitempty"`
- // The record's relevancy score. This is returned by the search APIs.
- Score *float64 `json:"score,omitempty"`
- // The record's table name. APIs that return records from multiple tables will set this field accordingly.
- Table *string `json:"table,omitempty"`
- // The time when the record was last updated.
- UpdatedAt *string `json:"updatedAt,omitempty"`
- // The record's version. Can be used for optimistic concurrency control.
- Version int `json:"version"`
- // Encoding/Decoding errors
- Warnings *[]string `json:"warnings,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/record_meta_xata_highlight_value.go b/xata/internal/fern-workspace/generated/go/record_meta_xata_highlight_value.go
deleted file mode 100644
index 8e8049c..0000000
--- a/xata/internal/fern-workspace/generated/go/record_meta_xata_highlight_value.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type RecordMetaXataHighlightValue struct {
- typeName string
- StringList []string
- StringUnknownMap map[string]any
-}
-
-func NewRecordMetaXataHighlightValueFromStringList(value []string) *RecordMetaXataHighlightValue {
- return &RecordMetaXataHighlightValue{typeName: "stringList", StringList: value}
-}
-
-func NewRecordMetaXataHighlightValueFromStringUnknownMap(value map[string]any) *RecordMetaXataHighlightValue {
- return &RecordMetaXataHighlightValue{typeName: "stringUnknownMap", StringUnknownMap: value}
-}
-
-func (r *RecordMetaXataHighlightValue) UnmarshalJSON(data []byte) error {
- var valueStringList []string
- if err := json.Unmarshal(data, &valueStringList); err == nil {
- r.typeName = "stringList"
- r.StringList = valueStringList
- return nil
- }
- var valueStringUnknownMap map[string]any
- if err := json.Unmarshal(data, &valueStringUnknownMap); err == nil {
- r.typeName = "stringUnknownMap"
- r.StringUnknownMap = valueStringUnknownMap
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, r)
-}
-
-func (r RecordMetaXataHighlightValue) MarshalJSON() ([]byte, error) {
- switch r.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", r.typeName, r)
- case "stringList":
- return json.Marshal(r.StringList)
- case "stringUnknownMap":
- return json.Marshal(r.StringUnknownMap)
- }
-}
-
-type RecordMetaXataHighlightValueVisitor interface {
- VisitStringList([]string) error
- VisitStringUnknownMap(map[string]any) error
-}
-
-func (r *RecordMetaXataHighlightValue) Accept(v RecordMetaXataHighlightValueVisitor) error {
- switch r.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", r.typeName, r)
- case "stringList":
- return v.VisitStringList(r.StringList)
- case "stringUnknownMap":
- return v.VisitStringUnknownMap(r.StringUnknownMap)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/records_client.go b/xata/internal/fern-workspace/generated/go/records_client.go
deleted file mode 100644
index 0bf10d4..0000000
--- a/xata/internal/fern-workspace/generated/go/records_client.go
+++ /dev/null
@@ -1,638 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- bytes "bytes"
- context "context"
- json "encoding/json"
- errors "errors"
- fmt "fmt"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
- io "io"
- http "net/http"
- url "net/url"
-)
-
-type RecordsClient interface {
- BulkInsertTableRecords(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *BulkInsertTableRecordsRequest) (*BulkInsertTableRecordsResponse, error)
- InsertRecord(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *InsertRecordRequest) (*InsertRecordResponse, error)
- GetRecord(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *GetRecordRequest) (*Record, error)
- UpsertRecordWithId(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *UpsertRecordWithIdRequest) (*UpsertRecordWithIdResponse, error)
- InsertRecordWithId(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *InsertRecordWithIdRequest) (*InsertRecordWithIdResponse, error)
- UpdateRecordWithId(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *UpdateRecordWithIdRequest) (*UpdateRecordWithIdResponse, error)
- DeleteRecord(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *DeleteRecordRequest) (*Record, error)
- BranchTransaction(ctx context.Context, dbBranchName DbBranchName, request *BranchTransactionRequest) (*TransactionSuccess, error)
-}
-
-func NewRecordsClient(opts ...core.ClientOption) RecordsClient {
- options := core.NewClientOptions()
- for _, opt := range opts {
- opt(options)
- }
- return &recordsClient{
- baseURL: options.BaseURL,
- httpClient: options.HTTPClient,
- header: options.ToHeader(),
- }
-}
-
-type recordsClient struct {
- baseURL string
- httpClient core.HTTPClient
- header http.Header
-}
-
-// Bulk insert records
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (r *recordsClient) BulkInsertTableRecords(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *BulkInsertTableRecordsRequest) (*BulkInsertTableRecordsResponse, error) {
- baseURL := "/"
- if r.baseURL != "" {
- baseURL = r.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/bulk", dbBranchName, tableName)
-
- queryParams := make(url.Values)
- for _, value := range request.Columns {
- queryParams.Add("columns", fmt.Sprintf("%v", *value))
- }
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 422:
- value := new(UnprocessableEntityError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *BulkInsertTableRecordsResponse
- if err := core.DoRequest(
- ctx,
- r.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- r.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Insert a new Record into the Table
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (r *recordsClient) InsertRecord(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *InsertRecordRequest) (*InsertRecordResponse, error) {
- baseURL := "/"
- if r.baseURL != "" {
- baseURL = r.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data", dbBranchName, tableName)
-
- queryParams := make(url.Values)
- for _, value := range request.Columns {
- queryParams.Add("columns", fmt.Sprintf("%v", *value))
- }
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *InsertRecordResponse
- if err := core.DoRequest(
- ctx,
- r.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- r.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Retrieve record by ID
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-func (r *recordsClient) GetRecord(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *GetRecordRequest) (*Record, error) {
- baseURL := "/"
- if r.baseURL != "" {
- baseURL = r.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v", dbBranchName, tableName, recordId)
-
- queryParams := make(url.Values)
- for _, value := range request.Columns {
- queryParams.Add("columns", fmt.Sprintf("%v", *value))
- }
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *Record
- if err := core.DoRequest(
- ctx,
- r.httpClient,
- endpointURL,
- http.MethodGet,
- request,
- &response,
- false,
- r.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-func (r *recordsClient) UpsertRecordWithId(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *UpsertRecordWithIdRequest) (*UpsertRecordWithIdResponse, error) {
- baseURL := "/"
- if r.baseURL != "" {
- baseURL = r.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v", dbBranchName, tableName, recordId)
-
- queryParams := make(url.Values)
- if request.IfVersion != nil {
- queryParams.Add("ifVersion", fmt.Sprintf("%v", *request.IfVersion))
- }
- for _, value := range request.Columns {
- queryParams.Add("columns", fmt.Sprintf("%v", *value))
- }
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 422:
- value := new(UnprocessableEntityError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *UpsertRecordWithIdResponse
- if err := core.DoRequest(
- ctx,
- r.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- r.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// By default, IDs are auto-generated when data is insterted into Xata. Sending a request to this endpoint allows us to insert a record with a pre-existing ID, bypassing the default automatic ID generation.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-func (r *recordsClient) InsertRecordWithId(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *InsertRecordWithIdRequest) (*InsertRecordWithIdResponse, error) {
- baseURL := "/"
- if r.baseURL != "" {
- baseURL = r.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v", dbBranchName, tableName, recordId)
-
- queryParams := make(url.Values)
- if request.CreateOnly != nil {
- queryParams.Add("createOnly", fmt.Sprintf("%v", *request.CreateOnly))
- }
- if request.IfVersion != nil {
- queryParams.Add("ifVersion", fmt.Sprintf("%v", *request.IfVersion))
- }
- for _, value := range request.Columns {
- queryParams.Add("columns", fmt.Sprintf("%v", *value))
- }
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 422:
- value := new(UnprocessableEntityError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *InsertRecordWithIdResponse
- if err := core.DoRequest(
- ctx,
- r.httpClient,
- endpointURL,
- http.MethodPut,
- request,
- &response,
- false,
- r.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-func (r *recordsClient) UpdateRecordWithId(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *UpdateRecordWithIdRequest) (*UpdateRecordWithIdResponse, error) {
- baseURL := "/"
- if r.baseURL != "" {
- baseURL = r.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v", dbBranchName, tableName, recordId)
-
- queryParams := make(url.Values)
- if request.IfVersion != nil {
- queryParams.Add("ifVersion", fmt.Sprintf("%v", *request.IfVersion))
- }
- for _, value := range request.Columns {
- queryParams.Add("columns", fmt.Sprintf("%v", *value))
- }
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 422:
- value := new(UnprocessableEntityError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *UpdateRecordWithIdResponse
- if err := core.DoRequest(
- ctx,
- r.httpClient,
- endpointURL,
- http.MethodPatch,
- request,
- &response,
- false,
- r.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Record name
-func (r *recordsClient) DeleteRecord(ctx context.Context, dbBranchName DbBranchName, tableName TableName, recordId RecordId, request *DeleteRecordRequest) (*Record, error) {
- baseURL := "/"
- if r.baseURL != "" {
- baseURL = r.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/data/%v", dbBranchName, tableName, recordId)
-
- queryParams := make(url.Values)
- for _, value := range request.Columns {
- queryParams.Add("columns", fmt.Sprintf("%v", *value))
- }
- if len(queryParams) > 0 {
- endpointURL += "?" + queryParams.Encode()
- }
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *Record
- if err := core.DoRequest(
- ctx,
- r.httpClient,
- endpointURL,
- http.MethodDelete,
- request,
- &response,
- false,
- r.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (r *recordsClient) BranchTransaction(ctx context.Context, dbBranchName DbBranchName, request *BranchTransactionRequest) (*TransactionSuccess, error) {
- baseURL := "/"
- if r.baseURL != "" {
- baseURL = r.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/transaction", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 429:
- value := new(TooManyRequestsError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *TransactionSuccess
- if err := core.DoRequest(
- ctx,
- r.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- r.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/records_metadata.go b/xata/internal/fern-workspace/generated/go/records_metadata.go
deleted file mode 100644
index eb902b3..0000000
--- a/xata/internal/fern-workspace/generated/go/records_metadata.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Records metadata
-type RecordsMetadata struct {
- Page *RecordsMetadataPage `json:"page,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/records_metadata_page.go b/xata/internal/fern-workspace/generated/go/records_metadata_page.go
deleted file mode 100644
index d91eeb1..0000000
--- a/xata/internal/fern-workspace/generated/go/records_metadata_page.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type RecordsMetadataPage struct {
- // last record id
- Cursor string `json:"cursor"`
- // true if more records can be fetched
- More bool `json:"more"`
- // the number of records returned per page
- Size float64 `json:"size"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/remove_git_branches_entry_request.go b/xata/internal/fern-workspace/generated/go/remove_git_branches_entry_request.go
deleted file mode 100644
index 897ff1a..0000000
--- a/xata/internal/fern-workspace/generated/go/remove_git_branches_entry_request.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// RemoveGitBranchesEntryRequest is an in-lined request used by the RemoveGitBranchesEntry endpoint.
-type RemoveGitBranchesEntryRequest struct {
- // The Git Branch to remove from the mapping
- GitBranch string `json:"-"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/resolve_branch_request.go b/xata/internal/fern-workspace/generated/go/resolve_branch_request.go
deleted file mode 100644
index e2988bc..0000000
--- a/xata/internal/fern-workspace/generated/go/resolve_branch_request.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// ResolveBranchRequest is an in-lined request used by the ResolveBranch endpoint.
-type ResolveBranchRequest struct {
- // The Git Branch
- GitBranch *string `json:"-"`
- // Default branch to fallback to
- FallbackBranch *string `json:"-"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/resolve_branch_response.go b/xata/internal/fern-workspace/generated/go/resolve_branch_response.go
deleted file mode 100644
index 94e8c5a..0000000
--- a/xata/internal/fern-workspace/generated/go/resolve_branch_response.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ResolveBranchResponse struct {
- Branch string `json:"branch"`
- Reason *ResolveBranchResponseReason `json:"reason,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/resolve_branch_response_reason.go b/xata/internal/fern-workspace/generated/go/resolve_branch_response_reason.go
deleted file mode 100644
index 6480ddf..0000000
--- a/xata/internal/fern-workspace/generated/go/resolve_branch_response_reason.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type ResolveBranchResponseReason struct {
- Code ResolveBranchResponseReasonCode `json:"code,omitempty"`
- Message string `json:"message"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/resolve_branch_response_reason_code.go b/xata/internal/fern-workspace/generated/go/resolve_branch_response_reason_code.go
deleted file mode 100644
index ca37961..0000000
--- a/xata/internal/fern-workspace/generated/go/resolve_branch_response_reason_code.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-type ResolveBranchResponseReasonCode uint8
-
-const (
- ResolveBranchResponseReasonCodeFoundInMapping ResolveBranchResponseReasonCode = iota + 1
- ResolveBranchResponseReasonCodeBranchExists
- ResolveBranchResponseReasonCodeFallbackBranch
- ResolveBranchResponseReasonCodeDefaultBranch
-)
-
-func (r ResolveBranchResponseReasonCode) String() string {
- switch r {
- default:
- return strconv.Itoa(int(r))
- case ResolveBranchResponseReasonCodeFoundInMapping:
- return "FOUND_IN_MAPPING"
- case ResolveBranchResponseReasonCodeBranchExists:
- return "BRANCH_EXISTS"
- case ResolveBranchResponseReasonCodeFallbackBranch:
- return "FALLBACK_BRANCH"
- case ResolveBranchResponseReasonCodeDefaultBranch:
- return "DEFAULT_BRANCH"
- }
-}
-
-func (r ResolveBranchResponseReasonCode) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", r.String())), nil
-}
-
-func (r *ResolveBranchResponseReasonCode) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "FOUND_IN_MAPPING":
- value := ResolveBranchResponseReasonCodeFoundInMapping
- *r = value
- case "BRANCH_EXISTS":
- value := ResolveBranchResponseReasonCodeBranchExists
- *r = value
- case "FALLBACK_BRANCH":
- value := ResolveBranchResponseReasonCodeFallbackBranch
- *r = value
- case "DEFAULT_BRANCH":
- value := ResolveBranchResponseReasonCodeDefaultBranch
- *r = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/rev_link.go b/xata/internal/fern-workspace/generated/go/rev_link.go
deleted file mode 100644
index 5b6cd12..0000000
--- a/xata/internal/fern-workspace/generated/go/rev_link.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type RevLink struct {
- Column string `json:"column"`
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/schema.go b/xata/internal/fern-workspace/generated/go/schema.go
deleted file mode 100644
index 0914c15..0000000
--- a/xata/internal/fern-workspace/generated/go/schema.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type Schema struct {
- Tables []*Table `json:"tables,omitempty"`
- TablesOrder *[]string `json:"tablesOrder,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/schema_edit_script.go b/xata/internal/fern-workspace/generated/go/schema_edit_script.go
deleted file mode 100644
index 3092669..0000000
--- a/xata/internal/fern-workspace/generated/go/schema_edit_script.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type SchemaEditScript struct {
- Operations []*MigrationOp `json:"operations,omitempty"`
- SourceMigrationId *string `json:"sourceMigrationID,omitempty"`
- TargetMigrationId *string `json:"targetMigrationID,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/search_and_filter_client.go b/xata/internal/fern-workspace/generated/go/search_and_filter_client.go
deleted file mode 100644
index 6d0528e..0000000
--- a/xata/internal/fern-workspace/generated/go/search_and_filter_client.go
+++ /dev/null
@@ -1,1543 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- bytes "bytes"
- context "context"
- json "encoding/json"
- errors "errors"
- fmt "fmt"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
- io "io"
- http "net/http"
-)
-
-type SearchAndFilterClient interface {
- SearchBranch(ctx context.Context, dbBranchName DbBranchName, request *SearchBranchRequest) (*SearchBranchResponse, error)
- AggregateTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *AggregateTableRequest) (*AggregateTableResponse, error)
- AskTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *AskTableRequest) (*AskTableResponse, error)
- AskTableSession(ctx context.Context, dbBranchName DbBranchName, tableName TableName, sessionId string, request *AskTableSessionRequest) (*AskTableSessionResponse, error)
- QueryTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *QueryTableRequest) (*QueryTableResponse, error)
- SearchTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *SearchTableRequest) (*SearchTableResponse, error)
- SummarizeTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *SummarizeTableRequest) (*SummarizeTableResponse, error)
- VectorSearchTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *VectorSearchTableRequest) (*VectorSearchTableResponse, error)
-}
-
-func NewSearchAndFilterClient(opts ...core.ClientOption) SearchAndFilterClient {
- options := core.NewClientOptions()
- for _, opt := range opts {
- opt(options)
- }
- return &searchAndFilterClient{
- baseURL: options.BaseURL,
- httpClient: options.HTTPClient,
- header: options.ToHeader(),
- }
-}
-
-type searchAndFilterClient struct {
- baseURL string
- httpClient core.HTTPClient
- header http.Header
-}
-
-// Run a free text search operation across the database branch.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-func (s *searchAndFilterClient) SearchBranch(ctx context.Context, dbBranchName DbBranchName, request *SearchBranchRequest) (*SearchBranchResponse, error) {
- baseURL := "/"
- if s.baseURL != "" {
- baseURL = s.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/search", dbBranchName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 503:
- value := new(ServiceUnavailableError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *SearchBranchResponse
- if err := core.DoRequest(
- ctx,
- s.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- s.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// This endpoint allows you to run aggregations (analytics) on the data from one table.
-// While the summary endpoint is served from a transactional store and the results are strongly
-// consistent, the aggregate endpoint is served from our columnar store and the results are
-// only eventually consistent. On the other hand, the aggregate endpoint uses a
-// store that is more appropiate for analytics, makes use of approximative algorithms
-// (e.g for cardinality), and is generally faster and can do more complex aggregations.
-//
-// For usage, see the [API Guide](https://xata.io/docs/api-guide/aggregate).
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (s *searchAndFilterClient) AggregateTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *AggregateTableRequest) (*AggregateTableResponse, error) {
- baseURL := "/"
- if s.baseURL != "" {
- baseURL = s.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/aggregate", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *AggregateTableResponse
- if err := core.DoRequest(
- ctx,
- s.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- s.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Ask your table a question. If the `Accept` header is set to `text/event-stream`, Xata will stream the results back as SSE's.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (s *searchAndFilterClient) AskTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *AskTableRequest) (*AskTableResponse, error) {
- baseURL := "/"
- if s.baseURL != "" {
- baseURL = s.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/ask", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 429:
- value := new(TooManyRequestsError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 503:
- value := new(ServiceUnavailableError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *AskTableResponse
- if err := core.DoRequest(
- ctx,
- s.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- s.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Ask a follow-up question. If the `Accept` header is set to `text/event-stream`, Xata will stream the results back as SSE's.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (s *searchAndFilterClient) AskTableSession(ctx context.Context, dbBranchName DbBranchName, tableName TableName, sessionId string, request *AskTableSessionRequest) (*AskTableSessionResponse, error) {
- baseURL := "/"
- if s.baseURL != "" {
- baseURL = s.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/ask/%v", dbBranchName, tableName, sessionId)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 429:
- value := new(TooManyRequestsError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 503:
- value := new(ServiceUnavailableError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *AskTableSessionResponse
- if err := core.DoRequest(
- ctx,
- s.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- s.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The Query Table API can be used to retrieve all records in a table.
-// The API support filtering, sorting, selecting a subset of columns, and pagination.
-//
-// The overall structure of the request looks like this:
-//
-// ```json
-// // POST /db/:/tables//query
-//
-// {
-// "columns": [...],
-// "filter": {
-// "$all": [...],
-// "$any": [...]
-// ...
-// },
-// "sort": {
-// "multiple": [...]
-// ...
-// },
-// "page": {
-// ...
-// }
-// }
-//
-// ```
-//
-// For usage, see also the [API Guide](https://xata.io/docs/api-guide/get).
-//
-// ### Column selection
-//
-// If the `columns` array is not specified, all columns are included. For link
-// fields, only the ID column of the linked records is included in the response.
-//
-// If the `columns` array is specified, only the selected and internal
-// columns `id` and `xata` are included. The `*` wildcard can be used to
-// select all columns.
-//
-// For objects and link fields, if the column name of the object is specified, we
-// include all of its sub-keys. If only some sub-keys are specified (via dotted
-// notation, e.g. `"settings.plan"` ), then only those sub-keys from the object
-// are included.
-//
-// By the way of example, assuming two tables like this:
-//
-// ```json {"truncate": true}
-//
-// {
-// "tables": [
-// {
-// "name": "teams",
-// "columns": [
-// {
-// "name": "name",
-// "type": "string"
-// },
-// {
-// "name": "owner",
-// "type": "link",
-// "link": {
-// "table": "users"
-// }
-// },
-// {
-// "name": "foundedDate",
-// "type": "datetime"
-// },
-// ]
-// },
-// {
-// "name": "users",
-// "columns": [
-// {
-// "name": "email",
-// "type": "email"
-// },
-// {
-// "name": "full_name",
-// "type": "string"
-// },
-// {
-// "name": "address",
-// "type": "object",
-// "columns": [
-// {
-// "name": "street",
-// "type": "string"
-// },
-// {
-// "name": "number",
-// "type": "int"
-// },
-// {
-// "name": "zipcode",
-// "type": "int"
-// }
-// ]
-// },
-// {
-// "name": "team",
-// "type": "link",
-// "link": {
-// "table": "teams"
-// }
-// }
-// ]
-// }
-// ]
-// }
-//
-// ```
-//
-// A query like this:
-//
-// ```json
-// POST /db/:/tables//query
-//
-// {
-// "columns": [
-// "name",
-// "address.*"
-// ]
-// }
-//
-// ```
-//
-// returns objects like:
-//
-// ```json
-//
-// {
-// "name": "Kilian",
-// "address": {
-// "street": "New street",
-// "number": 41,
-// "zipcode": 10407
-// }
-// }
-//
-// ```
-//
-// while a query like this:
-//
-// ```json
-// POST /db/:/tables//query
-//
-// {
-// "columns": [
-// "name",
-// "address.street"
-// ]
-// }
-//
-// ```
-//
-// returns objects like:
-//
-// ```json
-//
-// {
-// "id": "id1"
-// "xata": {
-// "version": 0
-// }
-// "name": "Kilian",
-// "address": {
-// "street": "New street"
-// }
-// }
-//
-// ```
-//
-// If you want to return all columns from the main table and selected columns from the linked table, you can do it like this:
-//
-// ```json
-//
-// {
-// "columns": ["*", "team.name"]
-// }
-//
-// ```
-//
-// The `"*"` in the above means all columns, including columns of objects. This returns data like:
-//
-// ```json
-//
-// {
-// "id": "id1"
-// "xata": {
-// "version": 0
-// }
-// "name": "Kilian",
-// "email": "kilian@gmail.com",
-// "address": {
-// "street": "New street",
-// "number": 41,
-// "zipcode": 10407
-// },
-// "team": {
-// "id": "XX",
-// "xata": {
-// "version": 0
-// },
-// "name": "first team"
-// }
-// }
-//
-// ```
-//
-// If you want all columns of the linked table, you can do:
-//
-// ```json
-//
-// {
-// "columns": ["*", "team.*"]
-// }
-//
-// ```
-//
-// This returns, for example:
-//
-// ```json
-//
-// {
-// "id": "id1"
-// "xata": {
-// "version": 0
-// }
-// "name": "Kilian",
-// "email": "kilian@gmail.com",
-// "address": {
-// "street": "New street",
-// "number": 41,
-// "zipcode": 10407
-// },
-// "team": {
-// "id": "XX",
-// "xata": {
-// "version": 0
-// },
-// "name": "first team",
-// "code": "A1",
-// "foundedDate": "2020-03-04T10:43:54.32Z"
-// }
-// }
-//
-// ```
-//
-// ### Filtering
-//
-// There are two types of operators:
-//
-// - Operators that work on a single column: `$is`, `$contains`, `$pattern`,
-// `$includes`, `$gt`, etc.
-// - Control operators that combine multiple conditions: `$any`, `$all`, `$not` ,
-// `$none`, etc.
-//
-// All operators start with an `$` to differentiate them from column names
-// (which are not allowed to start with a dollar sign).
-//
-// #### Exact matching and control operators
-//
-// Filter by one column:
-//
-// ```json
-//
-// {
-// "filter": {
-// "": "value"
-// }
-// }
-//
-// ```
-//
-// This is equivalent to using the `$is` operator:
-//
-// ```json
-//
-// {
-// "filter": {
-// "": {
-// "$is": "value"
-// }
-// }
-// }
-//
-// ```
-//
-// For example:
-//
-// ```json
-//
-// {
-// "filter": {
-// "name": "r2"
-// }
-// }
-//
-// ```
-//
-// Or:
-//
-// ```json
-//
-// {
-// "filter": {
-// "name": {
-// "$is": "r2"
-// }
-// }
-// }
-//
-// ```
-//
-// For objects, both dots and nested versions work:
-//
-// ```json
-//
-// {
-// "filter": {
-// "settings.plan": "free"
-// }
-// }
-//
-// ```
-//
-// ```json
-//
-// {
-// "filter": {
-// "settings": {
-// "plan": "free"
-// }
-// }
-// }
-//
-// ```
-//
-// If you want to OR together multiple values, you can use the `$any` operator with an array of values:
-//
-// ```json
-//
-// {
-// "filter": {
-// "settings.plan": { "$any": ["free", "paid"] }
-// }
-// }
-//
-// ```
-//
-// If you specify multiple columns in the same filter, they are logically AND'ed together:
-//
-// ```json
-//
-// {
-// "filter": {
-// "settings.dark": true,
-// "settings.plan": "free"
-// }
-// }
-//
-// ```
-//
-// The above matches if both conditions are met.
-//
-// To be more explicit about it, you can use `$all` or `$any`:
-//
-// ```json
-//
-// {
-// "filter": {
-// "$any": {
-// "settings.dark": true,
-// "settings.plan": "free"
-// }
-// }
-// }
-//
-// ```
-//
-// The `$all` and `$any` operators can also receive an array of objects, which allows for repeating column names:
-//
-// ```json
-//
-// {
-// "filter": {
-// "$any": [
-// {
-// "name": "r1"
-// },
-// {
-// "name": "r2"
-// }
-// ]
-// }
-// }
-//
-// ```
-//
-// You can check for a value being not-null with `$exists`:
-//
-// ```json
-//
-// {
-// "filter": {
-// "$exists": "settings"
-// }
-// }
-//
-// ```
-//
-// This can be combined with `$all` or `$any` :
-//
-// ```json
-//
-// {
-// "filter": {
-// "$all": [
-// {
-// "$exists": "settings"
-// },
-// {
-// "$exists": "name"
-// }
-// ]
-// }
-// }
-//
-// ```
-//
-// Or you can use the inverse operator `$notExists`:
-//
-// ```json
-//
-// {
-// "filter": {
-// "$notExists": "settings"
-// }
-// }
-//
-// ```
-//
-// #### Partial match
-//
-// `$contains` is the simplest operator for partial matching. Note that `$contains` operator can
-// cause performance issues at scale, because indices cannot be used.
-//
-// ```json
-//
-// {
-// "filter": {
-// "": {
-// "$contains": "value"
-// }
-// }
-// }
-//
-// ```
-//
-// Wildcards are supported via the `$pattern` operator:
-//
-// ```json
-//
-// {
-// "filter": {
-// "": {
-// "$pattern": "v*alu?"
-// }
-// }
-// }
-//
-// ```
-//
-// The `$pattern` operator accepts two wildcard characters:
-// * `*` matches zero or more characters
-// * `?` matches exactly one character
-//
-// If you want to match a string that contains a wildcard character, you can escape them using a backslash (`\`). You can escape a backslash by usign another backslash.
-//
-// You can also use the `$endsWith` and `$startsWith` operators:
-//
-// ```json
-//
-// {
-// "filter": {
-// "": {
-// "$endsWith": ".gz"
-// },
-// "": {
-// "$startsWith": "tmp-"
-// }
-// }
-// }
-//
-// ```
-//
-// #### Numeric or datetime ranges
-//
-// ```json
-//
-// {
-// "filter": {
-// "": {
-// "$ge": 0,
-// "$lt": 100
-// }
-// }
-// }
-//
-// ```
-// Date ranges support the same operators, with the date using the format defined in
-// [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339):
-// ```json
-//
-// {
-// "filter": {
-// "": {
-// "$gt": "2019-10-12T07:20:50.52Z",
-// "$lt": "2021-10-12T07:20:50.52Z"
-// }
-// }
-// }
-//
-// ```
-// The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
-//
-// #### Negations
-//
-// A general `$not` operator can inverse any operation.
-//
-// ```json
-//
-// {
-// "filter": {
-// "$not": {
-// "": "value1",
-// "": "value1"
-// }
-// }
-// }
-//
-// ```
-//
-// Note: in the above the two condition are AND together, so this does (NOT ( ...
-// AND ...))
-//
-// Or more complex:
-//
-// ```json
-//
-// {
-// "filter": {
-// "$not": {
-// "$any": [
-// {
-// "": "value1"
-// },
-// {
-// "$all": [
-// {
-// "": "value2"
-// },
-// {
-// "": "value3"
-// }
-// ]
-// }
-// ]
-// }
-// }
-// }
-//
-// ```
-//
-// The `$not: { $any: {}}` can be shorted using the `$none` operator:
-//
-// ```json
-//
-// {
-// "filter": {
-// "$none": {
-// "": "value1",
-// "": "value1"
-// }
-// }
-// }
-//
-// ```
-//
-// In addition, you can use operators like `$isNot` or `$notExists` to simplify expressions:
-//
-// ```json
-//
-// {
-// "filter": {
-// "": {
-// "$isNot": "2019-10-12T07:20:50.52Z"
-// }
-// }
-// }
-//
-// ```
-//
-// #### Working with arrays
-//
-// To test that an array contains a value, use `$includesAny`.
-//
-// ```json
-//
-// {
-// "filter": {
-// "": {
-// "$includesAny": "value"
-// }
-// }
-// }
-//
-// ```
-//
-// ##### `includesAny`
-//
-// The `$includesAny` operator accepts a custom predicate that will check if
-// any value in the array column matches the predicate. The `$includes` operator is a
-// synonym for the `$includesAny` operator.
-//
-// For example a complex predicate can include
-// the `$all` , `$contains` and `$endsWith` operators:
-//
-// ```json
-//
-// {
-// "filter": {
-// "": {
-// "$includes": {
-// "$all": [
-// { "$contains": "label" },
-// { "$not": { "$endsWith": "-debug" } }
-// ]
-// }
-// }
-// }
-// }
-//
-// ```
-//
-// ##### `includesNone`
-//
-// The `$includesNone` operator succeeds if no array item matches the
-// predicate.
-//
-// ```json
-//
-// {
-// "filter": {
-// "settings.labels": {
-// "$includesNone": [{ "$contains": "label" }]
-// }
-// }
-// }
-//
-// ```
-// The above matches if none of the array values contain the string "label".
-//
-// ##### `includesAll`
-//
-// The `$includesAll` operator succeeds if all array items match the
-// predicate.
-//
-// Here is an example of using the `$includesAll` operator:
-//
-// ```json
-//
-// {
-// "filter": {
-// "settings.labels": {
-// "$includesAll": [{ "$contains": "label" }]
-// }
-// }
-// }
-//
-// ```
-//
-// The above matches if all array values contain the string "label".
-//
-// ### Sorting
-//
-// Sorting by one element:
-//
-// ```json
-// POST /db/demo:main/tables/table/query
-//
-// {
-// "sort": {
-// "index": "asc"
-// }
-// }
-//
-// ```
-//
-// or descendently:
-//
-// ```json
-// POST /db/demo:main/tables/table/query
-//
-// {
-// "sort": {
-// "index": "desc"
-// }
-// }
-//
-// ```
-//
-// Sorting by multiple fields:
-//
-// ```json
-// POST /db/demo:main/tables/table/query
-//
-// {
-// "sort": [
-// {
-// "index": "desc"
-// },
-// {
-// "createdAt": "desc"
-// }
-// ]
-// }
-//
-// ```
-//
-// It is also possible to sort results randomly:
-//
-// ```json
-// POST /db/demo:main/tables/table/query
-//
-// {
-// "sort": {
-// "*": "random"
-// }
-// }
-//
-// ```
-//
-// Note that a random sort does not apply to a specific column, hence the special column name `"*"`.
-//
-// A random sort can be combined with an ascending or descending sort on a specific column:
-//
-// ```json
-// POST /db/demo:main/tables/table/query
-//
-// {
-// "sort": [
-// {
-// "name": "desc"
-// },
-// {
-// "*": "random"
-// }
-// ]
-// }
-//
-// ```
-//
-// This will sort on the `name` column, breaking ties randomly.
-//
-// ### Pagination
-//
-// We offer cursor pagination and offset pagination. The cursor pagination method can be used for sequential scrolling with unrestricted depth. The offset pagination can be used to skip pages and is limited to 1000 records.
-//
-// Example of cursor pagination:
-//
-// ```json
-// POST /db/demo:main/tables/table/query
-//
-// {
-// "page": {
-// "after":"fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD"
-// }
-// }
-//
-// ```
-//
-// In the above example, the value of the `page.after` parameter is the cursor returned by the previous query. A sample response is shown below:
-//
-// ```json
-//
-// {
-// "meta": {
-// "page": {
-// "cursor": "fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD",
-// "more": true
-// }
-// },
-// "records": [...]
-// }
-//
-// ```
-//
-// The `page` object might contain the follow keys, in addition to `size` and `offset` that were introduced before:
-//
-// - `after`: Return the next page 'after' the current cursor
-// - `before`: Return the previous page 'before' the current cursor.
-// - `start`: Resets the given cursor position to the beginning of the query result set.
-// Will return the first N records from the query result, where N is the `page.size` parameter.
-// - `end`: Resets the give cursor position to the end for the query result set.
-// Returns the last N records from the query result, where N is the `page.size` parameter.
-//
-// The request will fail if an invalid cursor value is given to `page.before`,
-// `page.after`, `page.start` , or `page.end`. No other cursor setting can be
-// used if `page.start` or `page.end` is set in a query.
-//
-// If both `page.before` and `page.after` parameters are present we treat the
-// request as a range query. The range query will return all entries after
-// `page.after`, but before `page.before`, up to `page.size` or the maximum
-// page size. This query requires both cursors to use the same filters and sort
-// settings, plus we require `page.after < page.before`. The range query returns
-// a new cursor. If the range encompass multiple pages the next page in the range
-// can be queried by update `page.after` to the returned cursor while keeping the
-// `page.before` cursor from the first range query.
-//
-// The `filter` , `columns`, `sort` , and `page.size` configuration will be
-// encoded with the cursor. The pagination request will be invalid if
-// `filter` or `sort` is set. The columns returned and page size can be changed
-// anytime by passing the `columns` or `page.size` settings to the next query.
-//
-// In the following example of size + offset pagination we retrieve the third page of up to 100 results:
-//
-// ```json
-// POST /db/demo:main/tables/table/query
-//
-// {
-// "page": {
-// "size": 100,
-// "offset": 200
-// }
-// }
-//
-// ```
-//
-// The `page.size` parameter represents the maximum number of records returned by this query. It has a default value of 20 and a maximum value of 200.
-// The `page.offset` parameter represents the number of matching records to skip. It has a default value of 0 and a maximum value of 800.
-//
-// Cursor pagination also works in combination with offset pagination. For example, starting from a specific cursor position, using a page size of 200 and an offset of 800, you can skip up to 5 pages of 200 records forwards or backwards from the cursor's position:
-//
-// ```json
-// POST /db/demo:main/tables/table/query
-//
-// {
-// "page": {
-// "size": 200,
-// "offset": 800,
-// "after": "fMoxCsIwFIDh3WP8c4amDai5hO5SJCRNfaVSeC9b6d1FD"
-// }
-// }
-//
-// ```
-//
-// **Special cursors:**
-//
-// - `page.after=end`: Result points past the last entry. The list of records
-// returned is empty, but `page.meta.cursor` will include a cursor that can be
-// used to "tail" the table from the end waiting for new data to be inserted.
-// - `page.before=end`: This cursor returns the last page.
-// - `page.start=$cursor`: Start at the beginning of the result set of the $cursor query. This is equivalent to querying the
-// first page without a cursor but applying `filter` and `sort` . Yet the `page.start`
-// cursor can be convenient at times as user code does not need to remember the
-// filter, sort, columns or page size configuration. All these information are
-// read from the cursor.
-// - `page.end=$cursor`: Move to the end of the result set of the $cursor query. This is equivalent to querying the
-// last page with `page.before=end`, `filter`, and `sort` . Yet the
-// `page.end` cursor can be more convenient at times as user code does not
-// need to remember the filter, sort, columns or page size configuration. All
-// these information are read from the cursor.
-//
-// When using special cursors like `page.after="end"` or `page.before="end"`, we
-// still allow `filter` and `sort` to be set.
-//
-// Example of getting the last page:
-//
-// ```json
-// POST /db/demo:main/tables/table/query
-//
-// {
-// "page": {
-// "size": 10,
-// "before": "end"
-// }
-// }
-//
-// ```
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (s *searchAndFilterClient) QueryTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *QueryTableRequest) (*QueryTableResponse, error) {
- baseURL := "/"
- if s.baseURL != "" {
- baseURL = s.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/query", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 503:
- value := new(ServiceUnavailableError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *QueryTableResponse
- if err := core.DoRequest(
- ctx,
- s.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- s.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Run a free text search operation in a particular table.
-//
-// The endpoint accepts a `query` parameter that is used for the free text search and a set of structured filters (via the `filter` parameter) that are applied before the search. The `filter` parameter uses the same syntax as the [query endpoint](/api-reference/db/db_branch_name/tables/table_name/) with the following exceptions:
-// * filters `$contains`, `$startsWith`, `$endsWith` don't work on columns of type `text`
-// * filtering on columns of type `multiple` is currently unsupported
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (s *searchAndFilterClient) SearchTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *SearchTableRequest) (*SearchTableResponse, error) {
- baseURL := "/"
- if s.baseURL != "" {
- baseURL = s.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/search", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *SearchTableResponse
- if err := core.DoRequest(
- ctx,
- s.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- s.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// This endpoint allows you to (optionally) define groups, and then to run
-// calculations on the values in each group. This is most helpful when
-// you'd like to understand the data you have in your database.
-//
-// A group is a combination of unique values. If you create a group for
-// `sold_by`, `product_name`, we will return one row for every combination
-// of `sold_by` and `product_name` you have in your database. When you
-// want to calculate statistics, you define these groups and ask Xata to
-// calculate data on each group.
-//
-// **Some questions you can ask of your data:**
-//
-// How many records do I have in this table?
-// - Set `columns: []` as we we want data from the entire table, so we ask
-// for no groups.
-// - Set `summaries: {"total": {"count": "*"}}` in order to see the count
-// of all records. We use `count: *` here we'd like to know the total
-// amount of rows; ignoring whether they are `null` or not.
-//
-// What are the top total sales for each product in July 2022 and sold
-// more than 10 units?
-// - Set `filter: {soldAt: {
-// "$ge": "2022-07-01T00:00:00.000Z",
-// "$lt": "2022-08-01T00:00:00.000Z"}
-// }`
-//
-// in order to limit the result set to sales recorded in July 2022.
-// - Set `columns: [product_name]` as we'd like to run calculations on
-// each unique product name in our table. Setting `columns` like this will
-// produce one row per unique product name.
-// - Set `summaries: {"total_sales": {"count": "product_name"}}` as we'd
-// like to create a field called "total_sales" for each group. This field
-// will count all rows in each group with non-null product names.
-// - Set `sort: [{"total_sales": "desc"}]` in order to bring the rows with
-// the highest total_sales field to the top.
-// - Set `summariesFilter: {"total_sales": {"$ge": 10}}` to only send back data
-// with greater than or equal to 10 units.
-//
-// `columns`: tells Xata how to create each group. If you add `product_id`
-// we will create a new group for every unique `product_id`.
-//
-// `summaries`: tells Xata which calculations to run on each group. Xata
-// currently supports count, min, max, sum, average.
-//
-// `sort`: tells Xata in which order you'd like to see results. You may
-// sort by fields specified in `columns` as well as the summary names
-// defined in `summaries`.
-//
-// note: Sorting on summarized values can be slower on very large tables;
-// this will impact your rate limit significantly more than other queries.
-// Try use `filter` to reduce the amount of data being processed in order
-// to reduce impact on your limits.
-//
-// `summariesFilter`: tells Xata how to filter the results of a summary.
-// It has the same syntax as `filter`, however, by using `summariesFilter`
-// you may also filter on the results of a query.
-//
-// note: This is a much slower to use than `filter`. We recommend using
-// `filter` wherever possible and `summariesFilter` when it's not
-// possible to use `filter`.
-//
-// `page.size`: tells Xata how many records to return. If unspecified, Xata
-// will return the default size.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (s *searchAndFilterClient) SummarizeTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *SummarizeTableRequest) (*SummarizeTableResponse, error) {
- baseURL := "/"
- if s.baseURL != "" {
- baseURL = s.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/summarize", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *SummarizeTableResponse
- if err := core.DoRequest(
- ctx,
- s.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- s.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// This endpoint can be used to perform vector-based similarity searches in a table.
-// It can be used for implementing semantic search and product recommendation. To use this
-// endpoint, you need a column of type vector. The input vector must have the same
-// dimension as the vector column.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (s *searchAndFilterClient) VectorSearchTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *VectorSearchTableRequest) (*VectorSearchTableResponse, error) {
- baseURL := "/"
- if s.baseURL != "" {
- baseURL = s.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/vectorSearch", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *VectorSearchTableResponse
- if err := core.DoRequest(
- ctx,
- s.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- s.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/search_branch_request.go b/xata/internal/fern-workspace/generated/go/search_branch_request.go
deleted file mode 100644
index d142ec7..0000000
--- a/xata/internal/fern-workspace/generated/go/search_branch_request.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// SearchBranchRequest is an in-lined request used by the SearchBranch endpoint.
-type SearchBranchRequest struct {
- Fuzziness *FuzzinessExpression `json:"fuzziness,omitempty"`
- Highlight *HighlightExpression `json:"highlight,omitempty"`
- Page *SearchPageConfig `json:"page,omitempty"`
- Prefix *PrefixExpression `json:"prefix,omitempty"`
- // The query string. `non-empty`
- Query string `json:"query"`
- // An array with the tables in which to search. By default, all tables are included. Optionally, filters can be included that apply to each table.
- Tables *[]*SearchBranchRequestTablesItem `json:"tables,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/search_branch_request_tables_item.go b/xata/internal/fern-workspace/generated/go/search_branch_request_tables_item.go
deleted file mode 100644
index 404d13f..0000000
--- a/xata/internal/fern-workspace/generated/go/search_branch_request_tables_item.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type SearchBranchRequestTablesItem struct {
- typeName string
- String string
- SearchBranchRequestTablesItemBoosters *SearchBranchRequestTablesItemBoosters
-}
-
-func NewSearchBranchRequestTablesItemFromString(value string) *SearchBranchRequestTablesItem {
- return &SearchBranchRequestTablesItem{typeName: "string", String: value}
-}
-
-func NewSearchBranchRequestTablesItemFromSearchBranchRequestTablesItemBoosters(value *SearchBranchRequestTablesItemBoosters) *SearchBranchRequestTablesItem {
- return &SearchBranchRequestTablesItem{typeName: "searchBranchRequestTablesItemBoosters", SearchBranchRequestTablesItemBoosters: value}
-}
-
-func (s *SearchBranchRequestTablesItem) UnmarshalJSON(data []byte) error {
- var valueString string
- if err := json.Unmarshal(data, &valueString); err == nil {
- s.typeName = "string"
- s.String = valueString
- return nil
- }
- valueSearchBranchRequestTablesItemBoosters := new(SearchBranchRequestTablesItemBoosters)
- if err := json.Unmarshal(data, &valueSearchBranchRequestTablesItemBoosters); err == nil {
- s.typeName = "searchBranchRequestTablesItemBoosters"
- s.SearchBranchRequestTablesItemBoosters = valueSearchBranchRequestTablesItemBoosters
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, s)
-}
-
-func (s SearchBranchRequestTablesItem) MarshalJSON() ([]byte, error) {
- switch s.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", s.typeName, s)
- case "string":
- return json.Marshal(s.String)
- case "searchBranchRequestTablesItemBoosters":
- return json.Marshal(s.SearchBranchRequestTablesItemBoosters)
- }
-}
-
-type SearchBranchRequestTablesItemVisitor interface {
- VisitString(string) error
- VisitSearchBranchRequestTablesItemBoosters(*SearchBranchRequestTablesItemBoosters) error
-}
-
-func (s *SearchBranchRequestTablesItem) Accept(v SearchBranchRequestTablesItemVisitor) error {
- switch s.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", s.typeName, s)
- case "string":
- return v.VisitString(s.String)
- case "searchBranchRequestTablesItemBoosters":
- return v.VisitSearchBranchRequestTablesItemBoosters(s.SearchBranchRequestTablesItemBoosters)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/search_branch_request_tables_item_boosters.go b/xata/internal/fern-workspace/generated/go/search_branch_request_tables_item_boosters.go
deleted file mode 100644
index 81472c7..0000000
--- a/xata/internal/fern-workspace/generated/go/search_branch_request_tables_item_boosters.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type SearchBranchRequestTablesItemBoosters struct {
- Boosters *[]*BoosterExpression `json:"boosters,omitempty"`
- Filter *FilterExpression `json:"filter,omitempty"`
- // The name of the table.
- Table string `json:"table"`
- Target *TargetExpression `json:"target,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/search_branch_response.go b/xata/internal/fern-workspace/generated/go/search_branch_response.go
deleted file mode 100644
index 69dfaca..0000000
--- a/xata/internal/fern-workspace/generated/go/search_branch_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type SearchBranchResponse struct {
- Records []*Record `json:"records,omitempty"`
- // The total count of records matched. It will be accurately returned up to 10000 records.
- TotalCount int `json:"totalCount"`
- Warning *string `json:"warning,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/search_page_config.go b/xata/internal/fern-workspace/generated/go/search_page_config.go
deleted file mode 100644
index 100d62a..0000000
--- a/xata/internal/fern-workspace/generated/go/search_page_config.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Pagination settings for the search endpoints.
-type SearchPageConfig struct {
- // Use offset to skip entries. To skip pages set offset to a multiple of size.
- Offset *int `json:"offset,omitempty"`
- // Set page size.
- Size *int `json:"size,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/search_table_request.go b/xata/internal/fern-workspace/generated/go/search_table_request.go
deleted file mode 100644
index 8185157..0000000
--- a/xata/internal/fern-workspace/generated/go/search_table_request.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// SearchTableRequest is an in-lined request used by the SearchTable endpoint.
-type SearchTableRequest struct {
- Boosters *[]*BoosterExpression `json:"boosters,omitempty"`
- Filter *FilterExpression `json:"filter,omitempty"`
- Fuzziness *FuzzinessExpression `json:"fuzziness,omitempty"`
- Highlight *HighlightExpression `json:"highlight,omitempty"`
- Page *SearchPageConfig `json:"page,omitempty"`
- Prefix *PrefixExpression `json:"prefix,omitempty"`
- // The query string. `non-empty`
- Query string `json:"query"`
- Target *TargetExpression `json:"target,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/search_table_response.go b/xata/internal/fern-workspace/generated/go/search_table_response.go
deleted file mode 100644
index f920a05..0000000
--- a/xata/internal/fern-workspace/generated/go/search_table_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type SearchTableResponse struct {
- Records []*Record `json:"records,omitempty"`
- // The total count of records matched. It will be accurately returned up to 10000 records.
- TotalCount int `json:"totalCount"`
- Warning *string `json:"warning,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/service_unavailable_error.go b/xata/internal/fern-workspace/generated/go/service_unavailable_error.go
deleted file mode 100644
index f7abb53..0000000
--- a/xata/internal/fern-workspace/generated/go/service_unavailable_error.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
-)
-
-type ServiceUnavailableError struct {
- *core.APIError
- Body any
-}
-
-func (s *ServiceUnavailableError) UnmarshalJSON(data []byte) error {
- var body any
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- s.StatusCode = 503
- s.Body = body
- return nil
-}
-
-func (s *ServiceUnavailableError) MarshalJSON() ([]byte, error) {
- return json.Marshal(s.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/set_table_schema_request.go b/xata/internal/fern-workspace/generated/go/set_table_schema_request.go
deleted file mode 100644
index 2e84d01..0000000
--- a/xata/internal/fern-workspace/generated/go/set_table_schema_request.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// SetTableSchemaRequest is an in-lined request used by the SetTableSchema endpoint.
-type SetTableSchemaRequest struct {
- Columns []*Column `json:"columns,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/set_table_schema_response.go b/xata/internal/fern-workspace/generated/go/set_table_schema_response.go
deleted file mode 100644
index 43b4ae3..0000000
--- a/xata/internal/fern-workspace/generated/go/set_table_schema_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type SetTableSchemaResponse struct {
- // `non-empty`
- MigrationId string `json:"migrationID"`
- ParentMigrationId string `json:"parentMigrationID"`
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/sort_expression.go b/xata/internal/fern-workspace/generated/go/sort_expression.go
deleted file mode 100644
index c7acbd8..0000000
--- a/xata/internal/fern-workspace/generated/go/sort_expression.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type SortExpression struct {
- typeName string
- StringList []string
- StringSortOrderMap map[string]SortOrder
- StringSortOrderMapList []map[string]SortOrder
-}
-
-func NewSortExpressionFromStringList(value []string) *SortExpression {
- return &SortExpression{typeName: "stringList", StringList: value}
-}
-
-func NewSortExpressionFromStringSortOrderMap(value map[string]SortOrder) *SortExpression {
- return &SortExpression{typeName: "stringSortOrderMap", StringSortOrderMap: value}
-}
-
-func NewSortExpressionFromStringSortOrderMapList(value []map[string]SortOrder) *SortExpression {
- return &SortExpression{typeName: "stringSortOrderMapList", StringSortOrderMapList: value}
-}
-
-func (s *SortExpression) UnmarshalJSON(data []byte) error {
- var valueStringList []string
- if err := json.Unmarshal(data, &valueStringList); err == nil {
- s.typeName = "stringList"
- s.StringList = valueStringList
- return nil
- }
- var valueStringSortOrderMap map[string]SortOrder
- if err := json.Unmarshal(data, &valueStringSortOrderMap); err == nil {
- s.typeName = "stringSortOrderMap"
- s.StringSortOrderMap = valueStringSortOrderMap
- return nil
- }
- var valueStringSortOrderMapList []map[string]SortOrder
- if err := json.Unmarshal(data, &valueStringSortOrderMapList); err == nil {
- s.typeName = "stringSortOrderMapList"
- s.StringSortOrderMapList = valueStringSortOrderMapList
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, s)
-}
-
-func (s SortExpression) MarshalJSON() ([]byte, error) {
- switch s.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", s.typeName, s)
- case "stringList":
- return json.Marshal(s.StringList)
- case "stringSortOrderMap":
- return json.Marshal(s.StringSortOrderMap)
- case "stringSortOrderMapList":
- return json.Marshal(s.StringSortOrderMapList)
- }
-}
-
-type SortExpressionVisitor interface {
- VisitStringList([]string) error
- VisitStringSortOrderMap(map[string]SortOrder) error
- VisitStringSortOrderMapList([]map[string]SortOrder) error
-}
-
-func (s *SortExpression) Accept(v SortExpressionVisitor) error {
- switch s.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", s.typeName, s)
- case "stringList":
- return v.VisitStringList(s.StringList)
- case "stringSortOrderMap":
- return v.VisitStringSortOrderMap(s.StringSortOrderMap)
- case "stringSortOrderMapList":
- return v.VisitStringSortOrderMapList(s.StringSortOrderMapList)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/sort_order.go b/xata/internal/fern-workspace/generated/go/sort_order.go
deleted file mode 100644
index 28b6168..0000000
--- a/xata/internal/fern-workspace/generated/go/sort_order.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-type SortOrder uint8
-
-const (
- SortOrderAsc SortOrder = iota + 1
- SortOrderDesc
- SortOrderRandom
-)
-
-func (s SortOrder) String() string {
- switch s {
- default:
- return strconv.Itoa(int(s))
- case SortOrderAsc:
- return "asc"
- case SortOrderDesc:
- return "desc"
- case SortOrderRandom:
- return "random"
- }
-}
-
-func (s SortOrder) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", s.String())), nil
-}
-
-func (s *SortOrder) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "asc":
- value := SortOrderAsc
- *s = value
- case "desc":
- value := SortOrderDesc
- *s = value
- case "random":
- value := SortOrderRandom
- *s = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/sql_record.go b/xata/internal/fern-workspace/generated/go/sql_record.go
deleted file mode 100644
index 53fbfa3..0000000
--- a/xata/internal/fern-workspace/generated/go/sql_record.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type SqlRecord = map[string]any
diff --git a/xata/internal/fern-workspace/generated/go/started_from_metadata.go b/xata/internal/fern-workspace/generated/go/started_from_metadata.go
deleted file mode 100644
index 326c8cf..0000000
--- a/xata/internal/fern-workspace/generated/go/started_from_metadata.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type StartedFromMetadata struct {
- BranchName BranchName `json:"branchName"`
- DbBranchId string `json:"dbBranchID"`
- MigrationId string `json:"migrationID"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/sum_agg.go b/xata/internal/fern-workspace/generated/go/sum_agg.go
deleted file mode 100644
index 53fa7a6..0000000
--- a/xata/internal/fern-workspace/generated/go/sum_agg.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// The sum of the numeric values in a particular column.
-type SumAgg struct {
- // The column on which to compute the sum. Must be a numeric type.
- Column string `json:"column"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/summarize_table_request.go b/xata/internal/fern-workspace/generated/go/summarize_table_request.go
deleted file mode 100644
index d220ac3..0000000
--- a/xata/internal/fern-workspace/generated/go/summarize_table_request.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// SummarizeTableRequest is an in-lined request used by the SummarizeTable endpoint.
-type SummarizeTableRequest struct {
- Columns *ColumnsProjection `json:"columns,omitempty"`
- // The consistency level for this request.
- Consistency *SummarizeTableRequestConsistency `json:"consistency,omitempty"`
- Filter *FilterExpression `json:"filter,omitempty"`
- Page *SummarizeTableRequestPage `json:"page,omitempty"`
- Sort *SortExpression `json:"sort,omitempty"`
- Summaries *SummaryExpressionList `json:"summaries,omitempty"`
- SummariesFilter *FilterExpression `json:"summariesFilter,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/summarize_table_request_consistency.go b/xata/internal/fern-workspace/generated/go/summarize_table_request_consistency.go
deleted file mode 100644
index eca6c6e..0000000
--- a/xata/internal/fern-workspace/generated/go/summarize_table_request_consistency.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
- strconv "strconv"
-)
-
-// The consistency level for this request.
-type SummarizeTableRequestConsistency uint8
-
-const (
- SummarizeTableRequestConsistencyStrong SummarizeTableRequestConsistency = iota + 1
- SummarizeTableRequestConsistencyEventual
-)
-
-func (s SummarizeTableRequestConsistency) String() string {
- switch s {
- default:
- return strconv.Itoa(int(s))
- case SummarizeTableRequestConsistencyStrong:
- return "strong"
- case SummarizeTableRequestConsistencyEventual:
- return "eventual"
- }
-}
-
-func (s SummarizeTableRequestConsistency) MarshalJSON() ([]byte, error) {
- return []byte(fmt.Sprintf("%q", s.String())), nil
-}
-
-func (s *SummarizeTableRequestConsistency) UnmarshalJSON(data []byte) error {
- var raw string
- if err := json.Unmarshal(data, &raw); err != nil {
- return err
- }
- switch raw {
- case "strong":
- value := SummarizeTableRequestConsistencyStrong
- *s = value
- case "eventual":
- value := SummarizeTableRequestConsistencyEventual
- *s = value
- }
- return nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/summarize_table_request_page.go b/xata/internal/fern-workspace/generated/go/summarize_table_request_page.go
deleted file mode 100644
index 8ab135c..0000000
--- a/xata/internal/fern-workspace/generated/go/summarize_table_request_page.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type SummarizeTableRequestPage struct {
- // The number of records returned by summarize. If the amount of data you have exceeds this, or you have
- // more complex reporting requirements, we recommend that you use the aggregate endpoint instead.
- Size *int `json:"size,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/summarize_table_response.go b/xata/internal/fern-workspace/generated/go/summarize_table_response.go
deleted file mode 100644
index e7a2b60..0000000
--- a/xata/internal/fern-workspace/generated/go/summarize_table_response.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type SummarizeTableResponse struct {
- Summaries []map[string]any `json:"summaries,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/summary_expression.go b/xata/internal/fern-workspace/generated/go/summary_expression.go
deleted file mode 100644
index 0ecc76c..0000000
--- a/xata/internal/fern-workspace/generated/go/summary_expression.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// A summary expression is the description of a single summary operation. It consists of a single
-// key representing the operation, and a value representing the column to be operated on.
-//
-// The column being summarized cannot be an internal column (id, xata.*), nor the base of
-// an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
-// `settings.dark_mode` but not `settings` nor `settings.*`.
-//
-// We currently support several aggregation functions. Not all functions can be run on all column
-// types.
-//
-// - `count` is used to count the number of records in each group. Use `{"count": "*"}` to count
-// all columns present, otherwise `{"count": ""}` to count the number of non-null
-// values are present at column path.
-//
-// Count can be used on any column type, and always returns an int.
-//
-// - `min` calculates the minimum value in each group. `min` is compatible with most types;
-// string, multiple, text, email, int, float, and datetime. It returns a value of the same
-// type as operated on. This means that `{"lowest_latency": {"min": "latency"}}` where
-// `latency` is an int, will always return an int.
-//
-// - `max` calculates the maximum value in each group. `max` shares the same compatibility as
-// `min`.
-//
-// - `sum` adds up all values in a group. `sum` can be run on `int` and `float` types, and will
-// return a value of the same type as requested.
-//
-// - `average` averages all values in a group. `average` can be run on `int` and `float` types, and
-// always returns a float.
-type SummaryExpression = map[string]any
diff --git a/xata/internal/fern-workspace/generated/go/summary_expression_list.go b/xata/internal/fern-workspace/generated/go/summary_expression_list.go
deleted file mode 100644
index cfc334f..0000000
--- a/xata/internal/fern-workspace/generated/go/summary_expression_list.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// The description of the summaries you wish to receive. Set each key to be the field name
-// you'd like for the summary. These names must not collide with other columns you've
-// requested from `columns`; including implicit requests like `settings.*`.
-//
-// The value for each key needs to be an object. This object should contain one key and one
-// value only. In this object, the key should be set to the summary function you wish to use
-// and the value set to the column name to be summarized.
-//
-// The column being summarized cannot be an internal column (id, xata.*), nor the base of
-// an object, i.e. if `settings` is an object with `dark_mode` as a field, you may summarize
-// `settings.dark_mode` but not `settings` nor `settings.*`.
-type SummaryExpressionList = map[string]SummaryExpression
diff --git a/xata/internal/fern-workspace/generated/go/table.go b/xata/internal/fern-workspace/generated/go/table.go
deleted file mode 100644
index 247b43d..0000000
--- a/xata/internal/fern-workspace/generated/go/table.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type Table struct {
- Columns []*Column `json:"columns,omitempty"`
- Id *string `json:"id,omitempty"`
- Name TableName `json:"name"`
- RevLinks *[]*RevLink `json:"revLinks,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/table_client.go b/xata/internal/fern-workspace/generated/go/table_client.go
deleted file mode 100644
index c789e99..0000000
--- a/xata/internal/fern-workspace/generated/go/table_client.go
+++ /dev/null
@@ -1,697 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- bytes "bytes"
- context "context"
- json "encoding/json"
- errors "errors"
- fmt "fmt"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
- io "io"
- http "net/http"
-)
-
-type TableClient interface {
- CreateTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName) (*CreateTableResponse, error)
- UpdateTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *UpdateTableRequest) (*UpdateTableResponse, error)
- DeleteTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName) (*DeleteTableResponse, error)
- GetTableColumns(ctx context.Context, dbBranchName DbBranchName, tableName TableName) (*GetTableColumnsResponse, error)
- AddTableColumn(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *Column) (*AddTableColumnResponse, error)
- GetColumn(ctx context.Context, dbBranchName DbBranchName, tableName TableName, columnName ColumnName) (*Column, error)
- UpdateColumn(ctx context.Context, dbBranchName DbBranchName, tableName TableName, columnName ColumnName, request *UpdateColumnRequest) (*UpdateColumnResponse, error)
- DeleteColumn(ctx context.Context, dbBranchName DbBranchName, tableName TableName, columnName ColumnName) (*DeleteColumnResponse, error)
- GetTableSchema(ctx context.Context, dbBranchName DbBranchName, tableName TableName) (*GetTableSchemaResponse, error)
- SetTableSchema(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *SetTableSchemaRequest) (*SetTableSchemaResponse, error)
-}
-
-func NewTableClient(opts ...core.ClientOption) TableClient {
- options := core.NewClientOptions()
- for _, opt := range opts {
- opt(options)
- }
- return &tableClient{
- baseURL: options.BaseURL,
- httpClient: options.HTTPClient,
- header: options.ToHeader(),
- }
-}
-
-type tableClient struct {
- baseURL string
- httpClient core.HTTPClient
- header http.Header
-}
-
-// Creates a new table with the given name. Returns 422 if a table with the same name already exists.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (t *tableClient) CreateTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName) (*CreateTableResponse, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 422:
- value := new(UnprocessableEntityError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *CreateTableResponse
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodPut,
- nil,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Update table. Currently there is only one update operation supported: renaming the table by providing a new name.
-//
-// In the example below, we rename a table from “users” to “people”:
-//
-// ```json
-// // PATCH /db/test:main/tables/users
-//
-// {
-// "name": "people"
-// }
-//
-// ```
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (t *tableClient) UpdateTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *UpdateTableRequest) (*UpdateTableResponse, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 422:
- value := new(UnprocessableEntityError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *UpdateTableResponse
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodPatch,
- request,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Deletes the table with the given name.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (t *tableClient) DeleteTable(ctx context.Context, dbBranchName DbBranchName, tableName TableName) (*DeleteTableResponse, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *DeleteTableResponse
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodDelete,
- nil,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Retrieves the list of table columns and their definition. This endpoint returns the column list with object columns being reported with their
-// full dot-separated path (flattened).
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (t *tableClient) GetTableColumns(ctx context.Context, dbBranchName DbBranchName, tableName TableName) (*GetTableColumnsResponse, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/columns", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *GetTableColumnsResponse
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Adds a new column to the table. The body of the request should contain the column definition.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (t *tableClient) AddTableColumn(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *Column) (*AddTableColumnResponse, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/columns", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *AddTableColumnResponse
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodPost,
- request,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Get the definition of a single column.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Column name
-func (t *tableClient) GetColumn(ctx context.Context, dbBranchName DbBranchName, tableName TableName, columnName ColumnName) (*Column, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/columns/%v", dbBranchName, tableName, columnName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *Column
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Update column with partial data. Can be used for renaming the column by providing a new "name" field.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Column name
-func (t *tableClient) UpdateColumn(ctx context.Context, dbBranchName DbBranchName, tableName TableName, columnName ColumnName, request *UpdateColumnRequest) (*UpdateColumnResponse, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/columns/%v", dbBranchName, tableName, columnName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *UpdateColumnResponse
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodPatch,
- request,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// Deletes the specified column.
-//
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-// The Column name
-func (t *tableClient) DeleteColumn(ctx context.Context, dbBranchName DbBranchName, tableName TableName, columnName ColumnName) (*DeleteColumnResponse, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/columns/%v", dbBranchName, tableName, columnName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *DeleteColumnResponse
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodDelete,
- nil,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (t *tableClient) GetTableSchema(ctx context.Context, dbBranchName DbBranchName, tableName TableName) (*GetTableSchemaResponse, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/schema", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *GetTableSchemaResponse
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodGet,
- nil,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
-
-// The DBBranchName matches the pattern `{db_name}:{branch_name}`.
-//
-// The Table name
-func (t *tableClient) SetTableSchema(ctx context.Context, dbBranchName DbBranchName, tableName TableName, request *SetTableSchemaRequest) (*SetTableSchemaResponse, error) {
- baseURL := "/"
- if t.baseURL != "" {
- baseURL = t.baseURL
- }
- endpointURL := fmt.Sprintf(baseURL+"/"+"db/%v/tables/%v/schema", dbBranchName, tableName)
-
- errorDecoder := func(statusCode int, body io.Reader) error {
- raw, err := io.ReadAll(body)
- if err != nil {
- return err
- }
- apiError := core.NewAPIError(statusCode, errors.New(string(raw)))
- decoder := json.NewDecoder(bytes.NewReader(raw))
- switch statusCode {
- case 400:
- value := new(BadRequestError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 401:
- value := new(UnauthorizedError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 404:
- value := new(NotFoundError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- case 409:
- value := new(ConflictError)
- value.APIError = apiError
- if err := decoder.Decode(value); err != nil {
- return err
- }
- return value
- }
- return apiError
- }
-
- var response *SetTableSchemaResponse
- if err := core.DoRequest(
- ctx,
- t.httpClient,
- endpointURL,
- http.MethodPut,
- request,
- &response,
- false,
- t.header,
- errorDecoder,
- ); err != nil {
- return response, err
- }
- return response, nil
-}
diff --git a/xata/internal/fern-workspace/generated/go/table_migration.go b/xata/internal/fern-workspace/generated/go/table_migration.go
deleted file mode 100644
index d76c5b3..0000000
--- a/xata/internal/fern-workspace/generated/go/table_migration.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TableMigration struct {
- ModifiedColumns *[]*ColumnMigration `json:"modifiedColumns,omitempty"`
- NewColumnOrder []string `json:"newColumnOrder,omitempty"`
- NewColumns *map[string]*Column `json:"newColumns,omitempty"`
- RemovedColumns *[]string `json:"removedColumns,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/table_name.go b/xata/internal/fern-workspace/generated/go/table_name.go
deleted file mode 100644
index 66a82aa..0000000
--- a/xata/internal/fern-workspace/generated/go/table_name.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// `non-empty` `<= 255 characters`
-type TableName = string
diff --git a/xata/internal/fern-workspace/generated/go/table_op_add.go b/xata/internal/fern-workspace/generated/go/table_op_add.go
deleted file mode 100644
index 461eb06..0000000
--- a/xata/internal/fern-workspace/generated/go/table_op_add.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TableOpAdd struct {
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/table_op_remove.go b/xata/internal/fern-workspace/generated/go/table_op_remove.go
deleted file mode 100644
index 8aba9fd..0000000
--- a/xata/internal/fern-workspace/generated/go/table_op_remove.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TableOpRemove struct {
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/table_op_rename.go b/xata/internal/fern-workspace/generated/go/table_op_rename.go
deleted file mode 100644
index 5dfee0b..0000000
--- a/xata/internal/fern-workspace/generated/go/table_op_rename.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TableOpRename struct {
- NewName string `json:"newName"`
- OldName string `json:"oldName"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/table_rename.go b/xata/internal/fern-workspace/generated/go/table_rename.go
deleted file mode 100644
index ca2d284..0000000
--- a/xata/internal/fern-workspace/generated/go/table_rename.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TableRename struct {
- // `non-empty`
- NewName string `json:"newName"`
- // `non-empty`
- OldName string `json:"oldName"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/target_expression.go b/xata/internal/fern-workspace/generated/go/target_expression.go
deleted file mode 100644
index bb4c454..0000000
--- a/xata/internal/fern-workspace/generated/go/target_expression.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// The target expression is used to filter the search results by the target columns.
-type TargetExpression = []*TargetExpressionItem
diff --git a/xata/internal/fern-workspace/generated/go/target_expression_item.go b/xata/internal/fern-workspace/generated/go/target_expression_item.go
deleted file mode 100644
index 4104a59..0000000
--- a/xata/internal/fern-workspace/generated/go/target_expression_item.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type TargetExpressionItem struct {
- typeName string
- String string
- TargetExpressionItemColumn *TargetExpressionItemColumn
-}
-
-func NewTargetExpressionItemFromString(value string) *TargetExpressionItem {
- return &TargetExpressionItem{typeName: "string", String: value}
-}
-
-func NewTargetExpressionItemFromTargetExpressionItemColumn(value *TargetExpressionItemColumn) *TargetExpressionItem {
- return &TargetExpressionItem{typeName: "targetExpressionItemColumn", TargetExpressionItemColumn: value}
-}
-
-func (t *TargetExpressionItem) UnmarshalJSON(data []byte) error {
- var valueString string
- if err := json.Unmarshal(data, &valueString); err == nil {
- t.typeName = "string"
- t.String = valueString
- return nil
- }
- valueTargetExpressionItemColumn := new(TargetExpressionItemColumn)
- if err := json.Unmarshal(data, &valueTargetExpressionItemColumn); err == nil {
- t.typeName = "targetExpressionItemColumn"
- t.TargetExpressionItemColumn = valueTargetExpressionItemColumn
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, t)
-}
-
-func (t TargetExpressionItem) MarshalJSON() ([]byte, error) {
- switch t.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", t.typeName, t)
- case "string":
- return json.Marshal(t.String)
- case "targetExpressionItemColumn":
- return json.Marshal(t.TargetExpressionItemColumn)
- }
-}
-
-type TargetExpressionItemVisitor interface {
- VisitString(string) error
- VisitTargetExpressionItemColumn(*TargetExpressionItemColumn) error
-}
-
-func (t *TargetExpressionItem) Accept(v TargetExpressionItemVisitor) error {
- switch t.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", t.typeName, t)
- case "string":
- return v.VisitString(t.String)
- case "targetExpressionItemColumn":
- return v.VisitTargetExpressionItemColumn(t.TargetExpressionItemColumn)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/target_expression_item_column.go b/xata/internal/fern-workspace/generated/go/target_expression_item_column.go
deleted file mode 100644
index ed35a6a..0000000
--- a/xata/internal/fern-workspace/generated/go/target_expression_item_column.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TargetExpressionItemColumn struct {
- // The name of the column.
- Column string `json:"column"`
- // The weight of the column.
- Weight *float64 `json:"weight,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/too_many_requests_error.go b/xata/internal/fern-workspace/generated/go/too_many_requests_error.go
deleted file mode 100644
index 9f11007..0000000
--- a/xata/internal/fern-workspace/generated/go/too_many_requests_error.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
-)
-
-type TooManyRequestsError struct {
- *core.APIError
- Body any
-}
-
-func (t *TooManyRequestsError) UnmarshalJSON(data []byte) error {
- var body any
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- t.StatusCode = 429
- t.Body = body
- return nil
-}
-
-func (t *TooManyRequestsError) MarshalJSON() ([]byte, error) {
- return json.Marshal(t.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/top_values_agg.go b/xata/internal/fern-workspace/generated/go/top_values_agg.go
deleted file mode 100644
index 85d01b6..0000000
--- a/xata/internal/fern-workspace/generated/go/top_values_agg.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Split data into buckets by the unique values in a column. Accepts sub-aggregations for each bucket.
-// The top values as ordered by the number of records (`$count`) are returned.
-type TopValuesAgg struct {
- Aggs *AggExpressionMap `json:"aggs,omitempty"`
- // The column to use for bucketing. Accepted types are `string`, `email`, `int`, `float`, or `bool`.
- Column string `json:"column"`
- // The maximum number of unique values to return.
- Size *int `json:"size,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_delete_op.go b/xata/internal/fern-workspace/generated/go/transaction_delete_op.go
deleted file mode 100644
index aeee6d4..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_delete_op.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// A delete operation. The transaction will continue if no record matches the ID by default. To override this behaviour, set failIfMissing to true.
-type TransactionDeleteOp struct {
- // If set, the call will return the requested fields as part of the response.
- Columns *[]string `json:"columns,omitempty"`
- // If true, the transaction will fail when the record doesn't exist.
- FailIfMissing *bool `json:"failIfMissing,omitempty"`
- Id RecordId `json:"id"`
- // The table name
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_error.go b/xata/internal/fern-workspace/generated/go/transaction_error.go
deleted file mode 100644
index ea63349..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_error.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// An error message from a failing transaction operation
-type TransactionError struct {
- // The index of the failing operation
- Index int `json:"index"`
- // The error message
- Message string `json:"message"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_failure.go b/xata/internal/fern-workspace/generated/go/transaction_failure.go
deleted file mode 100644
index a57173a..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_failure.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// An array of errors, with indices, from the transaction.
-type TransactionFailure struct {
- // An array of errors from the submitted operations.
- Errors []*TransactionError `json:"errors,omitempty"`
- // The request ID.
- Id string `json:"id"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_get_op.go b/xata/internal/fern-workspace/generated/go/transaction_get_op.go
deleted file mode 100644
index 3e4edc6..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_get_op.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Get by id operation.
-type TransactionGetOp struct {
- // If set, the call will return the requested fields as part of the response.
- Columns *[]string `json:"columns,omitempty"`
- Id RecordId `json:"id"`
- // The table name
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_insert_op.go b/xata/internal/fern-workspace/generated/go/transaction_insert_op.go
deleted file mode 100644
index f9440a5..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_insert_op.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Insert operation
-type TransactionInsertOp struct {
- // If set, the call will return the requested fields as part of the response.
- Columns *[]string `json:"columns,omitempty"`
- // createOnly is used to change how Xata acts when an explicit ID is set in the `record` key.
- //
- // If `createOnly` is set to `true`, Xata will only attempt to insert the record. If there's a conflict, Xata
- // will cancel the transaction.
- //
- // If `createOnly` is set to `false`, Xata will attempt to insert the record. If there's no
- // conflict, the record is inserted. If there is a conflict, Xata will replace the record.
- CreateOnly *bool `json:"createOnly,omitempty"`
- // The version of the record you expect to be overwriting. Only valid with an
- // explicit ID is also set in the `record` key.
- IfVersion *int `json:"ifVersion,omitempty"`
- // The record to insert. The `id` field is optional; when specified, it will be used as the ID for the record.
- Record map[string]any `json:"record,omitempty"`
- // The table name
- Table string `json:"table"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_operation.go b/xata/internal/fern-workspace/generated/go/transaction_operation.go
deleted file mode 100644
index aa02cf2..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_operation.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-// A transaction operation
-type TransactionOperation struct {
- typeName string
- TransactionOperationInsert *TransactionOperationInsert
- TransactionOperationUpdate *TransactionOperationUpdate
- TransactionOperationDelete *TransactionOperationDelete
- TransactionOperationGet *TransactionOperationGet
-}
-
-func NewTransactionOperationFromTransactionOperationInsert(value *TransactionOperationInsert) *TransactionOperation {
- return &TransactionOperation{typeName: "transactionOperationInsert", TransactionOperationInsert: value}
-}
-
-func NewTransactionOperationFromTransactionOperationUpdate(value *TransactionOperationUpdate) *TransactionOperation {
- return &TransactionOperation{typeName: "transactionOperationUpdate", TransactionOperationUpdate: value}
-}
-
-func NewTransactionOperationFromTransactionOperationDelete(value *TransactionOperationDelete) *TransactionOperation {
- return &TransactionOperation{typeName: "transactionOperationDelete", TransactionOperationDelete: value}
-}
-
-func NewTransactionOperationFromTransactionOperationGet(value *TransactionOperationGet) *TransactionOperation {
- return &TransactionOperation{typeName: "transactionOperationGet", TransactionOperationGet: value}
-}
-
-func (t *TransactionOperation) UnmarshalJSON(data []byte) error {
- valueTransactionOperationInsert := new(TransactionOperationInsert)
- if err := json.Unmarshal(data, &valueTransactionOperationInsert); err == nil {
- t.typeName = "transactionOperationInsert"
- t.TransactionOperationInsert = valueTransactionOperationInsert
- return nil
- }
- valueTransactionOperationUpdate := new(TransactionOperationUpdate)
- if err := json.Unmarshal(data, &valueTransactionOperationUpdate); err == nil {
- t.typeName = "transactionOperationUpdate"
- t.TransactionOperationUpdate = valueTransactionOperationUpdate
- return nil
- }
- valueTransactionOperationDelete := new(TransactionOperationDelete)
- if err := json.Unmarshal(data, &valueTransactionOperationDelete); err == nil {
- t.typeName = "transactionOperationDelete"
- t.TransactionOperationDelete = valueTransactionOperationDelete
- return nil
- }
- valueTransactionOperationGet := new(TransactionOperationGet)
- if err := json.Unmarshal(data, &valueTransactionOperationGet); err == nil {
- t.typeName = "transactionOperationGet"
- t.TransactionOperationGet = valueTransactionOperationGet
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, t)
-}
-
-func (t TransactionOperation) MarshalJSON() ([]byte, error) {
- switch t.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", t.typeName, t)
- case "transactionOperationInsert":
- return json.Marshal(t.TransactionOperationInsert)
- case "transactionOperationUpdate":
- return json.Marshal(t.TransactionOperationUpdate)
- case "transactionOperationDelete":
- return json.Marshal(t.TransactionOperationDelete)
- case "transactionOperationGet":
- return json.Marshal(t.TransactionOperationGet)
- }
-}
-
-type TransactionOperationVisitor interface {
- VisitTransactionOperationInsert(*TransactionOperationInsert) error
- VisitTransactionOperationUpdate(*TransactionOperationUpdate) error
- VisitTransactionOperationDelete(*TransactionOperationDelete) error
- VisitTransactionOperationGet(*TransactionOperationGet) error
-}
-
-func (t *TransactionOperation) Accept(v TransactionOperationVisitor) error {
- switch t.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", t.typeName, t)
- case "transactionOperationInsert":
- return v.VisitTransactionOperationInsert(t.TransactionOperationInsert)
- case "transactionOperationUpdate":
- return v.VisitTransactionOperationUpdate(t.TransactionOperationUpdate)
- case "transactionOperationDelete":
- return v.VisitTransactionOperationDelete(t.TransactionOperationDelete)
- case "transactionOperationGet":
- return v.VisitTransactionOperationGet(t.TransactionOperationGet)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_operation_delete.go b/xata/internal/fern-workspace/generated/go/transaction_operation_delete.go
deleted file mode 100644
index 6d6064b..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_operation_delete.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TransactionOperationDelete struct {
- Delete *TransactionDeleteOp `json:"delete,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_operation_get.go b/xata/internal/fern-workspace/generated/go/transaction_operation_get.go
deleted file mode 100644
index ed1e1a5..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_operation_get.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TransactionOperationGet struct {
- Get *TransactionGetOp `json:"get,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_operation_insert.go b/xata/internal/fern-workspace/generated/go/transaction_operation_insert.go
deleted file mode 100644
index c40f639..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_operation_insert.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TransactionOperationInsert struct {
- Insert *TransactionInsertOp `json:"insert,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_operation_update.go b/xata/internal/fern-workspace/generated/go/transaction_operation_update.go
deleted file mode 100644
index 843a73c..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_operation_update.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type TransactionOperationUpdate struct {
- Update *TransactionUpdateOp `json:"update,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_result_columns.go b/xata/internal/fern-workspace/generated/go/transaction_result_columns.go
deleted file mode 100644
index 5405e23..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_result_columns.go
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Fields to return in the transaction result.
-type TransactionResultColumns = map[string]any
diff --git a/xata/internal/fern-workspace/generated/go/transaction_result_delete.go b/xata/internal/fern-workspace/generated/go/transaction_result_delete.go
deleted file mode 100644
index 80e0325..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_result_delete.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
-)
-
-// A result from a delete operation.
-type TransactionResultDelete struct {
- Columns *TransactionResultColumns `json:"columns,omitempty"`
- // The number of deleted rows
- Rows int `json:"rows"`
- operation string
-}
-
-func (t *TransactionResultDelete) Operation() string {
- return t.operation
-}
-
-func (t *TransactionResultDelete) UnmarshalJSON(data []byte) error {
- type unmarshaler TransactionResultDelete
- var value unmarshaler
- if err := json.Unmarshal(data, &value); err != nil {
- return err
- }
- *t = TransactionResultDelete(value)
- t.operation = "delete"
- return nil
-}
-
-func (t *TransactionResultDelete) MarshalJSON() ([]byte, error) {
- type embed TransactionResultDelete
- var marshaler = struct {
- embed
- Operation string `json:"operation"`
- }{
- embed: embed(*t),
- Operation: "delete",
- }
- return json.Marshal(marshaler)
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_result_get.go b/xata/internal/fern-workspace/generated/go/transaction_result_get.go
deleted file mode 100644
index 5213013..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_result_get.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
-)
-
-// A result from a get operation.
-type TransactionResultGet struct {
- Columns *TransactionResultColumns `json:"columns,omitempty"`
- operation string
-}
-
-func (t *TransactionResultGet) Operation() string {
- return t.operation
-}
-
-func (t *TransactionResultGet) UnmarshalJSON(data []byte) error {
- type unmarshaler TransactionResultGet
- var value unmarshaler
- if err := json.Unmarshal(data, &value); err != nil {
- return err
- }
- *t = TransactionResultGet(value)
- t.operation = "get"
- return nil
-}
-
-func (t *TransactionResultGet) MarshalJSON() ([]byte, error) {
- type embed TransactionResultGet
- var marshaler = struct {
- embed
- Operation string `json:"operation"`
- }{
- embed: embed(*t),
- Operation: "get",
- }
- return json.Marshal(marshaler)
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_result_insert.go b/xata/internal/fern-workspace/generated/go/transaction_result_insert.go
deleted file mode 100644
index 8f91538..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_result_insert.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
-)
-
-// A result from an insert operation.
-type TransactionResultInsert struct {
- Columns *TransactionResultColumns `json:"columns,omitempty"`
- Id RecordId `json:"id"`
- // The number of affected rows
- Rows int `json:"rows"`
- operation string
-}
-
-func (t *TransactionResultInsert) Operation() string {
- return t.operation
-}
-
-func (t *TransactionResultInsert) UnmarshalJSON(data []byte) error {
- type unmarshaler TransactionResultInsert
- var value unmarshaler
- if err := json.Unmarshal(data, &value); err != nil {
- return err
- }
- *t = TransactionResultInsert(value)
- t.operation = "insert"
- return nil
-}
-
-func (t *TransactionResultInsert) MarshalJSON() ([]byte, error) {
- type embed TransactionResultInsert
- var marshaler = struct {
- embed
- Operation string `json:"operation"`
- }{
- embed: embed(*t),
- Operation: "insert",
- }
- return json.Marshal(marshaler)
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_result_update.go b/xata/internal/fern-workspace/generated/go/transaction_result_update.go
deleted file mode 100644
index ce5341e..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_result_update.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
-)
-
-// A result from an update operation.
-type TransactionResultUpdate struct {
- Columns *TransactionResultColumns `json:"columns,omitempty"`
- Id RecordId `json:"id"`
- // The number of updated rows
- Rows int `json:"rows"`
- operation string
-}
-
-func (t *TransactionResultUpdate) Operation() string {
- return t.operation
-}
-
-func (t *TransactionResultUpdate) UnmarshalJSON(data []byte) error {
- type unmarshaler TransactionResultUpdate
- var value unmarshaler
- if err := json.Unmarshal(data, &value); err != nil {
- return err
- }
- *t = TransactionResultUpdate(value)
- t.operation = "update"
- return nil
-}
-
-func (t *TransactionResultUpdate) MarshalJSON() ([]byte, error) {
- type embed TransactionResultUpdate
- var marshaler = struct {
- embed
- Operation string `json:"operation"`
- }{
- embed: embed(*t),
- Operation: "update",
- }
- return json.Marshal(marshaler)
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_success.go b/xata/internal/fern-workspace/generated/go/transaction_success.go
deleted file mode 100644
index 3cdd3bd..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_success.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// An ordered array of results from the submitted operations.
-type TransactionSuccess struct {
- Results []*TransactionSuccessResultsItem `json:"results,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_success_results_item.go b/xata/internal/fern-workspace/generated/go/transaction_success_results_item.go
deleted file mode 100644
index fc1ffc9..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_success_results_item.go
+++ /dev/null
@@ -1,97 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type TransactionSuccessResultsItem struct {
- typeName string
- TransactionResultInsert *TransactionResultInsert
- TransactionResultUpdate *TransactionResultUpdate
- TransactionResultDelete *TransactionResultDelete
- TransactionResultGet *TransactionResultGet
-}
-
-func NewTransactionSuccessResultsItemFromTransactionResultInsert(value *TransactionResultInsert) *TransactionSuccessResultsItem {
- return &TransactionSuccessResultsItem{typeName: "transactionResultInsert", TransactionResultInsert: value}
-}
-
-func NewTransactionSuccessResultsItemFromTransactionResultUpdate(value *TransactionResultUpdate) *TransactionSuccessResultsItem {
- return &TransactionSuccessResultsItem{typeName: "transactionResultUpdate", TransactionResultUpdate: value}
-}
-
-func NewTransactionSuccessResultsItemFromTransactionResultDelete(value *TransactionResultDelete) *TransactionSuccessResultsItem {
- return &TransactionSuccessResultsItem{typeName: "transactionResultDelete", TransactionResultDelete: value}
-}
-
-func NewTransactionSuccessResultsItemFromTransactionResultGet(value *TransactionResultGet) *TransactionSuccessResultsItem {
- return &TransactionSuccessResultsItem{typeName: "transactionResultGet", TransactionResultGet: value}
-}
-
-func (t *TransactionSuccessResultsItem) UnmarshalJSON(data []byte) error {
- valueTransactionResultInsert := new(TransactionResultInsert)
- if err := json.Unmarshal(data, &valueTransactionResultInsert); err == nil {
- t.typeName = "transactionResultInsert"
- t.TransactionResultInsert = valueTransactionResultInsert
- return nil
- }
- valueTransactionResultUpdate := new(TransactionResultUpdate)
- if err := json.Unmarshal(data, &valueTransactionResultUpdate); err == nil {
- t.typeName = "transactionResultUpdate"
- t.TransactionResultUpdate = valueTransactionResultUpdate
- return nil
- }
- valueTransactionResultDelete := new(TransactionResultDelete)
- if err := json.Unmarshal(data, &valueTransactionResultDelete); err == nil {
- t.typeName = "transactionResultDelete"
- t.TransactionResultDelete = valueTransactionResultDelete
- return nil
- }
- valueTransactionResultGet := new(TransactionResultGet)
- if err := json.Unmarshal(data, &valueTransactionResultGet); err == nil {
- t.typeName = "transactionResultGet"
- t.TransactionResultGet = valueTransactionResultGet
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, t)
-}
-
-func (t TransactionSuccessResultsItem) MarshalJSON() ([]byte, error) {
- switch t.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", t.typeName, t)
- case "transactionResultInsert":
- return json.Marshal(t.TransactionResultInsert)
- case "transactionResultUpdate":
- return json.Marshal(t.TransactionResultUpdate)
- case "transactionResultDelete":
- return json.Marshal(t.TransactionResultDelete)
- case "transactionResultGet":
- return json.Marshal(t.TransactionResultGet)
- }
-}
-
-type TransactionSuccessResultsItemVisitor interface {
- VisitTransactionResultInsert(*TransactionResultInsert) error
- VisitTransactionResultUpdate(*TransactionResultUpdate) error
- VisitTransactionResultDelete(*TransactionResultDelete) error
- VisitTransactionResultGet(*TransactionResultGet) error
-}
-
-func (t *TransactionSuccessResultsItem) Accept(v TransactionSuccessResultsItemVisitor) error {
- switch t.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", t.typeName, t)
- case "transactionResultInsert":
- return v.VisitTransactionResultInsert(t.TransactionResultInsert)
- case "transactionResultUpdate":
- return v.VisitTransactionResultUpdate(t.TransactionResultUpdate)
- case "transactionResultDelete":
- return v.VisitTransactionResultDelete(t.TransactionResultDelete)
- case "transactionResultGet":
- return v.VisitTransactionResultGet(t.TransactionResultGet)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/transaction_update_op.go b/xata/internal/fern-workspace/generated/go/transaction_update_op.go
deleted file mode 100644
index 5412703..0000000
--- a/xata/internal/fern-workspace/generated/go/transaction_update_op.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Update operation
-type TransactionUpdateOp struct {
- // If set, the call will return the requested fields as part of the response.
- Columns *[]string `json:"columns,omitempty"`
- // The fields of the record you'd like to update
- Fields map[string]any `json:"fields,omitempty"`
- Id RecordId `json:"id"`
- // The version of the record you expect to be updating
- IfVersion *int `json:"ifVersion,omitempty"`
- // The table name
- Table string `json:"table"`
- // Xata will insert this record if it cannot be found.
- Upsert *bool `json:"upsert,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/unauthorized_error.go b/xata/internal/fern-workspace/generated/go/unauthorized_error.go
deleted file mode 100644
index e0b78e9..0000000
--- a/xata/internal/fern-workspace/generated/go/unauthorized_error.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
-)
-
-type UnauthorizedError struct {
- *core.APIError
- Body any
-}
-
-func (u *UnauthorizedError) UnmarshalJSON(data []byte) error {
- var body any
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- u.StatusCode = 401
- u.Body = body
- return nil
-}
-
-func (u *UnauthorizedError) MarshalJSON() ([]byte, error) {
- return json.Marshal(u.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/unique_count_agg.go b/xata/internal/fern-workspace/generated/go/unique_count_agg.go
deleted file mode 100644
index 2acd2f7..0000000
--- a/xata/internal/fern-workspace/generated/go/unique_count_agg.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Count the number of distinct values in a particular column.
-type UniqueCountAgg struct {
- // The column from where to count the unique values.
- Column string `json:"column"`
- // The threshold under which the unique count is exact. If the number of unique
- // values in the column is higher than this threshold, the results are approximate.
- // Maximum value is 40,000, default value is 3000.
- PrecisionThreshold *int `json:"precisionThreshold,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/unprocessable_entity_error.go b/xata/internal/fern-workspace/generated/go/unprocessable_entity_error.go
deleted file mode 100644
index 345c882..0000000
--- a/xata/internal/fern-workspace/generated/go/unprocessable_entity_error.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- core "github.com/xataio/xata-go/xata/internal/fern-workspace/generated/go/core"
-)
-
-type UnprocessableEntityError struct {
- *core.APIError
- Body any
-}
-
-func (u *UnprocessableEntityError) UnmarshalJSON(data []byte) error {
- var body any
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- u.StatusCode = 422
- u.Body = body
- return nil
-}
-
-func (u *UnprocessableEntityError) MarshalJSON() ([]byte, error) {
- return json.Marshal(u.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/update_branch_schema_response.go b/xata/internal/fern-workspace/generated/go/update_branch_schema_response.go
deleted file mode 100644
index 0e2d751..0000000
--- a/xata/internal/fern-workspace/generated/go/update_branch_schema_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type UpdateBranchSchemaResponse struct {
- // `non-empty`
- MigrationId string `json:"migrationID"`
- ParentMigrationId string `json:"parentMigrationID"`
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/update_column_request.go b/xata/internal/fern-workspace/generated/go/update_column_request.go
deleted file mode 100644
index 783aec2..0000000
--- a/xata/internal/fern-workspace/generated/go/update_column_request.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// UpdateColumnRequest is an in-lined request used by the UpdateColumn endpoint.
-type UpdateColumnRequest struct {
- // `non-empty`
- Name string `json:"name"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/update_column_response.go b/xata/internal/fern-workspace/generated/go/update_column_response.go
deleted file mode 100644
index 3901f3c..0000000
--- a/xata/internal/fern-workspace/generated/go/update_column_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type UpdateColumnResponse struct {
- // `non-empty`
- MigrationId string `json:"migrationID"`
- ParentMigrationId string `json:"parentMigrationID"`
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/update_record_with_id_request.go b/xata/internal/fern-workspace/generated/go/update_record_with_id_request.go
deleted file mode 100644
index bc068c6..0000000
--- a/xata/internal/fern-workspace/generated/go/update_record_with_id_request.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
-)
-
-// UpdateRecordWithIdRequest is an in-lined request used by the UpdateRecordWithId endpoint.
-type UpdateRecordWithIdRequest struct {
- IfVersion *int `json:"-"`
- // Column filters
- Columns []*string `json:"-"`
- Body map[string]*DataInputRecordValue `json:"-"`
-}
-
-func (u *UpdateRecordWithIdRequest) UnmarshalJSON(data []byte) error {
- var body map[string]*DataInputRecordValue
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- u.Body = body
- return nil
-}
-
-func (u *UpdateRecordWithIdRequest) MarshalJSON() ([]byte, error) {
- return json.Marshal(u.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/update_record_with_id_response.go b/xata/internal/fern-workspace/generated/go/update_record_with_id_response.go
deleted file mode 100644
index c31f885..0000000
--- a/xata/internal/fern-workspace/generated/go/update_record_with_id_response.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type UpdateRecordWithIdResponse struct {
- typeName string
- Record *Record
- UpdateRecordWithIdResponseId *UpdateRecordWithIdResponseId
-}
-
-func NewUpdateRecordWithIdResponseFromRecord(value *Record) *UpdateRecordWithIdResponse {
- return &UpdateRecordWithIdResponse{typeName: "record", Record: value}
-}
-
-func NewUpdateRecordWithIdResponseFromUpdateRecordWithIdResponseId(value *UpdateRecordWithIdResponseId) *UpdateRecordWithIdResponse {
- return &UpdateRecordWithIdResponse{typeName: "updateRecordWithIdResponseId", UpdateRecordWithIdResponseId: value}
-}
-
-func (u *UpdateRecordWithIdResponse) UnmarshalJSON(data []byte) error {
- valueRecord := new(Record)
- if err := json.Unmarshal(data, &valueRecord); err == nil {
- u.typeName = "record"
- u.Record = valueRecord
- return nil
- }
- valueUpdateRecordWithIdResponseId := new(UpdateRecordWithIdResponseId)
- if err := json.Unmarshal(data, &valueUpdateRecordWithIdResponseId); err == nil {
- u.typeName = "updateRecordWithIdResponseId"
- u.UpdateRecordWithIdResponseId = valueUpdateRecordWithIdResponseId
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, u)
-}
-
-func (u UpdateRecordWithIdResponse) MarshalJSON() ([]byte, error) {
- switch u.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", u.typeName, u)
- case "record":
- return json.Marshal(u.Record)
- case "updateRecordWithIdResponseId":
- return json.Marshal(u.UpdateRecordWithIdResponseId)
- }
-}
-
-type UpdateRecordWithIdResponseVisitor interface {
- VisitRecord(*Record) error
- VisitUpdateRecordWithIdResponseId(*UpdateRecordWithIdResponseId) error
-}
-
-func (u *UpdateRecordWithIdResponse) Accept(v UpdateRecordWithIdResponseVisitor) error {
- switch u.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", u.typeName, u)
- case "record":
- return v.VisitRecord(u.Record)
- case "updateRecordWithIdResponseId":
- return v.VisitUpdateRecordWithIdResponseId(u.UpdateRecordWithIdResponseId)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/update_record_with_id_response_id.go b/xata/internal/fern-workspace/generated/go/update_record_with_id_response_id.go
deleted file mode 100644
index 1aa35dd..0000000
--- a/xata/internal/fern-workspace/generated/go/update_record_with_id_response_id.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type UpdateRecordWithIdResponseId struct {
- Id string `json:"id"`
- Xata *UpdateRecordWithIdResponseIdXata `json:"xata,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/update_record_with_id_response_id_xata.go b/xata/internal/fern-workspace/generated/go/update_record_with_id_response_id_xata.go
deleted file mode 100644
index 3190bd6..0000000
--- a/xata/internal/fern-workspace/generated/go/update_record_with_id_response_id_xata.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type UpdateRecordWithIdResponseIdXata struct {
- CreatedAt string `json:"createdAt"`
- UpdatedAt string `json:"updatedAt"`
- Version int `json:"version"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/update_table_request.go b/xata/internal/fern-workspace/generated/go/update_table_request.go
deleted file mode 100644
index d99329e..0000000
--- a/xata/internal/fern-workspace/generated/go/update_table_request.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// UpdateTableRequest is an in-lined request used by the UpdateTable endpoint.
-type UpdateTableRequest struct {
- // `non-empty`
- Name string `json:"name"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/update_table_response.go b/xata/internal/fern-workspace/generated/go/update_table_response.go
deleted file mode 100644
index d0091ab..0000000
--- a/xata/internal/fern-workspace/generated/go/update_table_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type UpdateTableResponse struct {
- // `non-empty`
- MigrationId string `json:"migrationID"`
- ParentMigrationId string `json:"parentMigrationID"`
- Status MigrationStatus `json:"status,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/upsert_record_with_id_request.go b/xata/internal/fern-workspace/generated/go/upsert_record_with_id_request.go
deleted file mode 100644
index 4e591ce..0000000
--- a/xata/internal/fern-workspace/generated/go/upsert_record_with_id_request.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
-)
-
-// UpsertRecordWithIdRequest is an in-lined request used by the UpsertRecordWithId endpoint.
-type UpsertRecordWithIdRequest struct {
- IfVersion *int `json:"-"`
- // Column filters
- Columns []*string `json:"-"`
- Body map[string]*DataInputRecordValue `json:"-"`
-}
-
-func (u *UpsertRecordWithIdRequest) UnmarshalJSON(data []byte) error {
- var body map[string]*DataInputRecordValue
- if err := json.Unmarshal(data, &body); err != nil {
- return err
- }
- u.Body = body
- return nil
-}
-
-func (u *UpsertRecordWithIdRequest) MarshalJSON() ([]byte, error) {
- return json.Marshal(u.Body)
-}
diff --git a/xata/internal/fern-workspace/generated/go/upsert_record_with_id_response.go b/xata/internal/fern-workspace/generated/go/upsert_record_with_id_response.go
deleted file mode 100644
index 8ccbbf8..0000000
--- a/xata/internal/fern-workspace/generated/go/upsert_record_with_id_response.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-type UpsertRecordWithIdResponse struct {
- typeName string
- Record *Record
- UpsertRecordWithIdResponseId *UpsertRecordWithIdResponseId
-}
-
-func NewUpsertRecordWithIdResponseFromRecord(value *Record) *UpsertRecordWithIdResponse {
- return &UpsertRecordWithIdResponse{typeName: "record", Record: value}
-}
-
-func NewUpsertRecordWithIdResponseFromUpsertRecordWithIdResponseId(value *UpsertRecordWithIdResponseId) *UpsertRecordWithIdResponse {
- return &UpsertRecordWithIdResponse{typeName: "upsertRecordWithIdResponseId", UpsertRecordWithIdResponseId: value}
-}
-
-func (u *UpsertRecordWithIdResponse) UnmarshalJSON(data []byte) error {
- valueRecord := new(Record)
- if err := json.Unmarshal(data, &valueRecord); err == nil {
- u.typeName = "record"
- u.Record = valueRecord
- return nil
- }
- valueUpsertRecordWithIdResponseId := new(UpsertRecordWithIdResponseId)
- if err := json.Unmarshal(data, &valueUpsertRecordWithIdResponseId); err == nil {
- u.typeName = "upsertRecordWithIdResponseId"
- u.UpsertRecordWithIdResponseId = valueUpsertRecordWithIdResponseId
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, u)
-}
-
-func (u UpsertRecordWithIdResponse) MarshalJSON() ([]byte, error) {
- switch u.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", u.typeName, u)
- case "record":
- return json.Marshal(u.Record)
- case "upsertRecordWithIdResponseId":
- return json.Marshal(u.UpsertRecordWithIdResponseId)
- }
-}
-
-type UpsertRecordWithIdResponseVisitor interface {
- VisitRecord(*Record) error
- VisitUpsertRecordWithIdResponseId(*UpsertRecordWithIdResponseId) error
-}
-
-func (u *UpsertRecordWithIdResponse) Accept(v UpsertRecordWithIdResponseVisitor) error {
- switch u.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", u.typeName, u)
- case "record":
- return v.VisitRecord(u.Record)
- case "upsertRecordWithIdResponseId":
- return v.VisitUpsertRecordWithIdResponseId(u.UpsertRecordWithIdResponseId)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/upsert_record_with_id_response_id.go b/xata/internal/fern-workspace/generated/go/upsert_record_with_id_response_id.go
deleted file mode 100644
index ee838a1..0000000
--- a/xata/internal/fern-workspace/generated/go/upsert_record_with_id_response_id.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type UpsertRecordWithIdResponseId struct {
- Id string `json:"id"`
- Xata *UpsertRecordWithIdResponseIdXata `json:"xata,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/upsert_record_with_id_response_id_xata.go b/xata/internal/fern-workspace/generated/go/upsert_record_with_id_response_id_xata.go
deleted file mode 100644
index e992f66..0000000
--- a/xata/internal/fern-workspace/generated/go/upsert_record_with_id_response_id_xata.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type UpsertRecordWithIdResponseIdXata struct {
- CreatedAt string `json:"createdAt"`
- UpdatedAt string `json:"updatedAt"`
- Version int `json:"version"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/value_booster.go b/xata/internal/fern-workspace/generated/go/value_booster.go
deleted file mode 100644
index dead647..0000000
--- a/xata/internal/fern-workspace/generated/go/value_booster.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// Boost records with a particular value for a column.
-type ValueBooster struct {
- // The column in which to look for the value.
- Column string `json:"column"`
- // The factor with which to multiply the added boost.
- Factor float64 `json:"factor"`
- IfMatchesFilter *FilterExpression `json:"ifMatchesFilter,omitempty"`
- // The exact value to boost.
- Value *ValueBoosterValue `json:"value,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/value_booster_value.go b/xata/internal/fern-workspace/generated/go/value_booster_value.go
deleted file mode 100644
index da0f92d..0000000
--- a/xata/internal/fern-workspace/generated/go/value_booster_value.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-import (
- json "encoding/json"
- fmt "fmt"
-)
-
-// The exact value to boost.
-type ValueBoosterValue struct {
- typeName string
- String string
- Double float64
- Boolean bool
-}
-
-func NewValueBoosterValueFromString(value string) *ValueBoosterValue {
- return &ValueBoosterValue{typeName: "string", String: value}
-}
-
-func NewValueBoosterValueFromDouble(value float64) *ValueBoosterValue {
- return &ValueBoosterValue{typeName: "double", Double: value}
-}
-
-func NewValueBoosterValueFromBoolean(value bool) *ValueBoosterValue {
- return &ValueBoosterValue{typeName: "boolean", Boolean: value}
-}
-
-func (v *ValueBoosterValue) UnmarshalJSON(data []byte) error {
- var valueString string
- if err := json.Unmarshal(data, &valueString); err == nil {
- v.typeName = "string"
- v.String = valueString
- return nil
- }
- var valueDouble float64
- if err := json.Unmarshal(data, &valueDouble); err == nil {
- v.typeName = "double"
- v.Double = valueDouble
- return nil
- }
- var valueBoolean bool
- if err := json.Unmarshal(data, &valueBoolean); err == nil {
- v.typeName = "boolean"
- v.Boolean = valueBoolean
- return nil
- }
- return fmt.Errorf("%s cannot be deserialized as a %T", data, v)
-}
-
-func (v ValueBoosterValue) MarshalJSON() ([]byte, error) {
- switch v.typeName {
- default:
- return nil, fmt.Errorf("invalid type %s in %T", v.typeName, v)
- case "string":
- return json.Marshal(v.String)
- case "double":
- return json.Marshal(v.Double)
- case "boolean":
- return json.Marshal(v.Boolean)
- }
-}
-
-type ValueBoosterValueVisitor interface {
- VisitString(string) error
- VisitDouble(float64) error
- VisitBoolean(bool) error
-}
-
-func (v *ValueBoosterValue) Accept(v ValueBoosterValueVisitor) error {
- switch v.typeName {
- default:
- return fmt.Errorf("invalid type %s in %T", v.typeName, v)
- case "string":
- return v.VisitString(v.String)
- case "double":
- return v.VisitDouble(v.Double)
- case "boolean":
- return v.VisitBoolean(v.Boolean)
- }
-}
diff --git a/xata/internal/fern-workspace/generated/go/vector_search_table_request.go b/xata/internal/fern-workspace/generated/go/vector_search_table_request.go
deleted file mode 100644
index 585d5e5..0000000
--- a/xata/internal/fern-workspace/generated/go/vector_search_table_request.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-// VectorSearchTableRequest is an in-lined request used by the VectorSearchTable endpoint.
-type VectorSearchTableRequest struct {
- // The vector column in which to search. It must be of type `vector`.
- Column string `json:"column"`
- Filter *FilterExpression `json:"filter,omitempty"`
- // The vector to search for similarities. Must have the same dimension as
- // the vector column used.
- QueryVector []float64 `json:"queryVector,omitempty"`
- // The function used to measure the distance between two points. Can be one of:
- // `cosineSimilarity`, `l1`, `l2`. The default is `cosineSimilarity`.
- SimilarityFunction *string `json:"similarityFunction,omitempty"`
- // Number of results to return.
- Size *int `json:"size,omitempty"`
-}
diff --git a/xata/internal/fern-workspace/generated/go/vector_search_table_response.go b/xata/internal/fern-workspace/generated/go/vector_search_table_response.go
deleted file mode 100644
index b9bdc6a..0000000
--- a/xata/internal/fern-workspace/generated/go/vector_search_table_response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file was auto-generated by Fern from our API Definition.
-
-package api
-
-type VectorSearchTableResponse struct {
- Records []*Record `json:"records,omitempty"`
- // The total count of records matched. It will be accurately returned up to 10000 records.
- TotalCount int `json:"totalCount"`
- Warning *string `json:"warning,omitempty"`
-}