Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@abnegate
Copy link
Member

@abnegate abnegate commented Sep 23, 2025

This PR contains updates to the Go SDK for version v0.12.0.

Summary by CodeRabbit

  • New Features

    • Added random ordering support in queries.
    • Introduced new email verification flow with dedicated endpoints.
  • Chores

    • Bumped SDK version to v0.12.0.
    • Marked legacy account verification methods as deprecated.
    • Updated changelog with v0.12.0 details.
  • Documentation

    • Added usage examples for creating and completing email verification.
    • Updated database and tables examples to reflect new default geometry shapes.
    • Refreshed documentation links and clarified comments across functions, sites, tables, and health models.

@coderabbitai
Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

  • Bumps SDK version headers to v0.12.0 and updates CHANGELOG with deprecations for Account.createVerification, adding Account.createEmailVerification and query.OrderRandom.
  • Adds Account methods: CreateEmailVerification and UpdateEmailVerification; marks older CreateVerification/UpdateVerification as deprecated and aligned to /account/verifications/email.
  • Introduces query.OrderRandom().
  • Updates docs/examples for account email verification and adjusts geo default values in databases/tablesdb examples.
  • Modifies comments/links in functions, sites, tablesdb, and health/status models.
  • Reorders ProviderBranch field within models.Deployment.
  • Clarifies comments in models.Execution and health-related structs.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely summarizes the primary change—updating the Go SDK to version v0.12.0—which aligns with the changelog entry and the bulk of the alterations in this pull request.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

CHANGELOG.md Outdated


## 0.11.0
## 0.12.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we missing changelog here?

@ChiragAgg5k ChiragAgg5k changed the title feat: Go SDK update for version 0.12.0 feat: Go SDK update for version 0.13.0 Oct 3, 2025
@ChiragAgg5k ChiragAgg5k changed the title feat: Go SDK update for version 0.13.0 feat: Go SDK update for version 0.13.1 Oct 8, 2025
@ChiragAgg5k ChiragAgg5k changed the title feat: Go SDK update for version 0.13.1 feat: Go SDK update for version 0.14.0 Oct 8, 2025
@ChiragAgg5k ChiragAgg5k changed the title feat: Go SDK update for version 0.14.0 feat: Go SDK update for version v0.12.0 Oct 8, 2025
@abnegate abnegate merged commit 52a20ec into main Oct 8, 2025
1 check was pending
@abnegate abnegate deleted the dev branch October 8, 2025 07:54
@abnegate abnegate restored the dev branch October 8, 2025 07:54
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (1)
account/account.go (1)

2096-2144: Consider having the deprecated method delegate to the new one.

The deprecated CreateVerification method has an identical implementation to CreateEmailVerification. To reduce duplication and ensure consistency, consider having the deprecated method simply call the new one:

 func (srv *Account) CreateVerification(Url string)(*models.Token, error) {
-	path := "/account/verifications/email"
-	params := map[string]interface{}{}
-	params["url"] = Url
-	headers := map[string]interface{}{
-		"content-type": "application/json",
-	}
-
-	resp, err := srv.client.Call("POST", path, headers, params)
-	if err != nil {
-		return nil, err
-	}
-	if strings.HasPrefix(resp.Type, "application/json") {
-		bytes := []byte(resp.Result.(string))
-
-		parsed := models.Token{}.New(bytes)
-
-		err = json.Unmarshal(bytes, parsed)
-		if err != nil {
-			return nil, err
-		}
-
-		return parsed, nil
-	}
-	var parsed models.Token
-	parsed, ok := resp.Result.(models.Token)
-	if !ok {
-		return nil, errors.New("unexpected response type")
-	}
-	return &parsed, nil
-
+	return srv.CreateEmailVerification(Url)
 }

This reduces maintenance burden and ensures the deprecated method automatically benefits from any future bug fixes to the new method. The same refactor applies to UpdateVerification as well.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f499be5 and c72c757.

📒 Files selected for processing (25)
  • CHANGELOG.md (2 hunks)
  • account/account.go (5 hunks)
  • client/client.go (1 hunks)
  • docs/examples/account/create-email-verification.md (1 hunks)
  • docs/examples/account/update-email-verification.md (1 hunks)
  • docs/examples/databases/create-line-attribute.md (1 hunks)
  • docs/examples/databases/create-point-attribute.md (1 hunks)
  • docs/examples/databases/create-polygon-attribute.md (1 hunks)
  • docs/examples/databases/update-line-attribute.md (1 hunks)
  • docs/examples/databases/update-point-attribute.md (1 hunks)
  • docs/examples/databases/update-polygon-attribute.md (1 hunks)
  • docs/examples/tablesdb/create-line-column.md (1 hunks)
  • docs/examples/tablesdb/create-point-column.md (1 hunks)
  • docs/examples/tablesdb/create-polygon-column.md (1 hunks)
  • docs/examples/tablesdb/update-line-column.md (1 hunks)
  • docs/examples/tablesdb/update-point-column.md (1 hunks)
  • docs/examples/tablesdb/update-polygon-column.md (1 hunks)
  • functions/functions.go (1 hunks)
  • models/deployment.go (1 hunks)
  • models/execution.go (1 hunks)
  • models/health_antivirus.go (1 hunks)
  • models/health_status.go (1 hunks)
  • query/query.go (1 hunks)
  • sites/sites.go (1 hunks)
  • tablesdb/tables_db.go (5 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
account/account.go (1)
client/client.go (1)
  • New (74-104)
🪛 markdownlint-cli2 (0.18.1)
CHANGELOG.md

48-48: Multiple headings with the same content

(MD024, no-duplicate-heading)

🔇 Additional comments (17)
functions/functions.go (1)

941-941: LGTM! Documentation URL updated to align with new structure.

The change updates the reference URL from the server-specific path to the products path, which aligns with the broader documentation restructuring mentioned in the AI summary.

docs/examples/databases/update-point-attribute.md (1)

22-22: LGTM! Corrected example data for point attribute.

The default value now correctly represents a single point (1, 2) rather than the previous nested structure. This aligns with the semantic meaning of a "point" attribute.

models/health_antivirus.go (1)

12-12: LGTM! Grammar correction.

Fixed grammatical error in the comment from "Possible values can are" to "Possible values are".

client/client.go (1)

77-81: Version headers updated correctly, but verify target version.

The SDK version headers have been updated from 0.11.0 to v0.12.0 (with the "v" prefix added). Both user-agent and x-sdk-version are updated consistently.

However, the PR title indicates this is for version 0.14.0, while the code changes show v0.12.0. Please verify this is intentional or if the version numbers need adjustment.

tablesdb/tables_db.go (1)

385-385: LGTM! Documentation URL updated consistently.

The reference URL has been updated from /docs/server/tablesdb#createTable to /docs/references/cloud/server-dart/tablesDB#createTable to align with the new documentation structure. This same pattern is applied consistently at lines 2936, 2984, and 3024.

models/execution.go (1)

32-35: LGTM! Comment corrected to match field semantics.

The comment now correctly describes "HTTP request headers" instead of "HTTP response headers", which aligns with the field name RequestHeaders.

docs/examples/databases/create-polygon-attribute.md (1)

22-22: LGTM! Polygon example now shows valid closed polygon.

The default value has been updated to a proper closed polygon with four points: [[1, 2], [3, 4], [5, 6], [1, 2]]. This is more correct than the previous example, as a polygon requires at least three vertices and should be closed (first point equals last point).

docs/examples/databases/update-polygon-attribute.md (1)

22-22: LGTM! Polygon example consistent with create example.

The default value has been updated to match the pattern in create-polygon-attribute.md, using a proper closed polygon with four points. This maintains consistency across the polygon attribute examples.

docs/examples/tablesdb/create-polygon-column.md (1)

22-22: LGTM! Polygon example improved with proper closure.

The updated example now demonstrates a properly closed polygon with the closing coordinate matching the starting point. This is a best practice for polygon geometry.

docs/examples/tablesdb/create-line-column.md (1)

22-22: LGTM! Line example expanded.

The additional coordinate pair makes the example more comprehensive by demonstrating a line with multiple segments.

docs/examples/databases/create-line-attribute.md (1)

22-22: LGTM! Consistent with other line examples.

The expansion to three coordinate pairs is consistent with the parallel change in docs/examples/tablesdb/create-line-column.md.

query/query.go (1)

274-278: LGTM! OrderRandom() implementation is correct.

The new function follows the established pattern for query functions and correctly omits the attribute parameter, which is appropriate for random ordering.

docs/examples/databases/create-point-attribute.md (1)

22-22: LGTM! Simplified point representation.

The change from a nested array to a simple coordinate pair {1, 2} is more intuitive for representing a point attribute.

models/health_status.go (1)

14-14: LGTM! Grammar correction.

Fixed the typo from "Possible values can are" to "Possible values are".

sites/sites.go (1)

898-899: LGTM! Documentation URL updated.

The comment now references the updated documentation path for site templates.

account/account.go (2)

2048-2094: LGTM! Well-structured new email verification method.

The implementation follows the established patterns in the codebase with proper error handling and response parsing.


2146-2182: LGTM! New email verification completion method is well-implemented.

The UpdateEmailVerification method properly handles the verification completion flow with consistent error handling and response parsing.



## 0.11.0
## v0.12.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove the duplicate v0.12.0 heading.

We now have two ## v0.12.0 sections. Drop the second one (or rename it) to satisfy MD024 and keep the changelog clear.

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

48-48: Multiple headings with the same content

(MD024, no-duplicate-heading)

🤖 Prompt for AI Agents
In CHANGELOG.md around line 48, there is a duplicate "## v0.12.0" heading;
remove the second occurrence (or rename it to the correct version if it was
meant to be different) so only one "## v0.12.0" section remains, ensuring
surrounding entries and formatting stay intact.

"",
false,
databases.WithUpdateLineAttributeDefault(interface{}{[1,2], [3, 4]}),
databases.WithUpdateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix invalid Go literal for default coordinates.

interface{}{[1, 2], …} won’t compile in Go because neither interface{} nor [1, 2] form valid composite literals. Use a properly typed slice of coordinate pairs instead.

Apply this diff to make the example compile:

-    databases.WithUpdateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}),
+    databases.WithUpdateLineAttributeDefault([][]float64{{1, 2}, {3, 4}, {5, 6}}),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
databases.WithUpdateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}),
databases.WithUpdateLineAttributeDefault([][]float64{{1, 2}, {3, 4}, {5, 6}}),
🤖 Prompt for AI Agents
In docs/examples/databases/update-line-attribute.md around line 22, the default
coordinates use an invalid Go literal `interface{}{[1, 2], [3, 4], [5, 6]}`
which won't compile; replace it with a properly typed slice of coordinate pairs
such as a slice of int slices (e.g. [][]int{{1, 2}, {3, 4}, {5, 6}}) or a slice
of interfaces containing int slices (e.g. []interface{}{[]int{1,2}, []int{3,4},
[]int{5,6}}) so the example compiles.

"",
false,
tablesdb.WithCreatePointColumnDefault(interface{}{[1,2], [3, 4]}),
tablesdb.WithCreatePointColumnDefault(interface{}{1, 2}),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use a typed slice for the point default.

interface{}{1, 2} is not valid Go syntax. A point should be expressed as a slice with an explicit element type.

Replace with:

-    tablesdb.WithCreatePointColumnDefault(interface{}{1, 2}),
+    tablesdb.WithCreatePointColumnDefault([]float64{1, 2}),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tablesdb.WithCreatePointColumnDefault(interface{}{1, 2}),
tablesdb.WithCreatePointColumnDefault([]float64{1, 2}),
🤖 Prompt for AI Agents
In docs/examples/tablesdb/create-point-column.md around line 22, the default
point value uses invalid Go syntax `interface{}{1, 2}`; replace it with a slice
literal that includes an explicit element type (for example a slice of floats)
containing the coordinate values so the default is a properly typed slice like a
float32 or float64 slice with the two numbers.

"",
false,
tablesdb.WithUpdateLineColumnDefault(interface{}{[1,2], [3, 4]}),
tablesdb.WithUpdateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Correct the default slice literal.

interface{}{[...], ...} is invalid Go; the snippet won’t build as written. Provide a typed slice of coordinate pairs.

Suggested fix:

-    tablesdb.WithUpdateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}),
+    tablesdb.WithUpdateLineColumnDefault([][]float64{{1, 2}, {3, 4}, {5, 6}}),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tablesdb.WithUpdateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}),
tablesdb.WithUpdateLineColumnDefault([][]float64{{1, 2}, {3, 4}, {5, 6}}),
🤖 Prompt for AI Agents
In docs/examples/tablesdb/update-line-column.md around line 22, the default
slice literal uses an invalid untyped empty interface form `interface{}{[1,2],
[3,4], [5,6]}`; replace it with a properly typed slice of coordinate pairs (for
example a slice of [2]int or []int pairs, or the concrete type the API expects)
so the literal compiles—construct and pass a typed slice like [][2]int{ {1,2},
{3,4}, {5,6} } or the equivalent concrete type required by
tablesdb.WithUpdateLineColumnDefault.

"",
false,
tablesdb.WithUpdatePointColumnDefault(interface{}{[1,2], [3, 4]}),
tablesdb.WithUpdatePointColumnDefault(interface{}{1, 2}),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the point default literal.

interface{}{1, 2} can’t compile; declare the slice with a concrete element type.

Suggested change:

-    tablesdb.WithUpdatePointColumnDefault(interface{}{1, 2}),
+    tablesdb.WithUpdatePointColumnDefault([]float64{1, 2}),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tablesdb.WithUpdatePointColumnDefault(interface{}{1, 2}),
tablesdb.WithUpdatePointColumnDefault([]float64{1, 2}),
🤖 Prompt for AI Agents
In docs/examples/tablesdb/update-point-column.md around line 22, the default
uses the invalid literal `interface{}{1, 2}` which won't compile; replace it
with a concrete-typed slice literal (for example `[]int{1, 2}` or the
appropriate numeric type like `[]float64{1, 2}`) so the point default has a
concrete element type.

"",
false,
tablesdb.WithUpdatePolygonColumnDefault(interface{}{[1,2], [3, 4]}),
tablesdb.WithUpdatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Provide a correctly typed polygon literal.

The current interface{}{[[...]]} form is illegal Go. Supply a properly typed polygon (slice of linear rings).

One fix:

-    tablesdb.WithUpdatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}),
+    tablesdb.WithUpdatePolygonColumnDefault([][][]float64{{{1, 2}, {3, 4}, {5, 6}, {1, 2}}}),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tablesdb.WithUpdatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}),
tablesdb.WithUpdatePolygonColumnDefault([][][]float64{{{1, 2}, {3, 4}, {5, 6}, {1, 2}}}),
🤖 Prompt for AI Agents
In docs/examples/tablesdb/update-polygon-column.md around line 22, the literal
uses the illegal Go form `interface{}{[[...]]}`; replace it with a properly
typed polygon literal: provide an outer slice of linear rings where each ring is
a slice of coordinate pairs (use a type like [][][]float64 or [][][2]float64
depending on the library), and populate it with the coordinate arrays so the
outer slice contains one or more rings and each ring contains ordered [x,y]
pairs.

Comment on lines 61 to 64
// The branch of the vcs repository
ProviderBranch string `json:"providerBranch"`
// The branch of the vcs repository
ProviderBranchUrl string `json:"providerBranchUrl"`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix duplicate comment for ProviderBranchUrl.

Line 63 contains a duplicate comment "The branch of the vcs repository" that should describe ProviderBranchUrl on line 64, not repeat the comment for ProviderBranch from line 61-62.

Apply this diff to correct the comment:

 // The branch of the vcs repository
 ProviderBranch string `json:"providerBranch"`
-// The branch of the vcs repository
+// The URL of the vcs branch
 ProviderBranchUrl string `json:"providerBranchUrl"`
🤖 Prompt for AI Agents
In models/deployment.go around lines 61 to 64, the comment for ProviderBranchUrl
incorrectly duplicates the comment for ProviderBranch; update the comment on the
ProviderBranchUrl field to describe that it is the URL for the branch in the VCS
(e.g., "The URL of the branch in the VCS repository") so the two fields have
distinct, accurate comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants