You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportconst PyVersioningTags ="# Create a tag pointing at a specific version\ntable.tags.create(\"baseline\", 1)\ntable.tags.create(\"with-edits\", table.version)\n\n# List all tags on this table\nprint(table.tags.list())\n\n# Look up the version a tag points at\nprint(table.tags.get_version(\"baseline\"))\n\n# Move an existing tag to a different version\ntable.tags.update(\"baseline\", 2)\n\n# Check out a version by tag name\ntable.checkout(\"baseline\")\nprint(table.version)\n\n# Delete a tag (does not delete the underlying version)\ntable.tags.delete(\"with-edits\")\n\n# Return to the latest version\ntable.checkout_latest()\n";
124
124
125
-
exportconst PyVersioningBranches ="# Fork a new branch from the latest version of main\nexperiment = table.branches.create(\"experiment\")\nprint(experiment.current_branch()) # \"experiment\"\n\n# Writes on the branch handle do not affect main\nexperiment.add([{\"author\": \"Maya\", \"quote\": \"draft idea\"}])\n\n# List all branches on the table\nprint(table.branches.list())\n\n# Reopen an existing branch later (writable handle that tracks the branch tip)\nexperiment = table.branches.checkout(\"experiment\")\n\n# Pin a branch to a specific version (read-only view of that version)\nsnapshot = table.branches.checkout(\"experiment\", version=2)\n\n# Open a branch directly from the connection\nexperiment = db.open_table(\"my_table\", branch=\"experiment\")\n\n# Delete a branch when you're done with it\ntable.branches.delete(\"experiment\")\n";
126
-
127
125
exportconst PyVersioningUpdateData ="table.update(where=\"author='Richard'\", values={\"author\": \"Richard Daniel Sanchez\"})\nrows_after_update = table.count_rows(\"author = 'Richard Daniel Sanchez'\")\nprint(f\"Rows updated to Richard Daniel Sanchez: {rows_after_update}\")\n";
exportconst TsVersioningTags ="const tags = await tagsTable.tags();\n\n// Create a tag pointing at a specific version\nawait tags.create(\"baseline\", 1);\nawait tags.create(\"with-edits\", await tagsTable.version());\n\n// List all tags on this table\nconsole.log(await tags.list());\n\n// Look up the version a tag points at\nconsole.log(await tags.getVersion(\"baseline\"));\n\n// Move an existing tag to a different version\nawait tags.update(\"baseline\", 2);\n\n// Check out a version by tag name\nawait tagsTable.checkout(\"baseline\");\nconsole.log(await tagsTable.version());\n\n// Delete a tag (does not delete the underlying version)\nawait tags.delete(\"with-edits\");\n\n// Return to the latest version\nawait tagsTable.checkoutLatest();\n";
222
220
223
-
exportconst TsVersioningBranches ="const branches = await table.branches();\n\n// Fork a new branch from the latest version of main\nconst experiment = await branches.create(\"experiment\");\nconsole.log(experiment.currentBranch); // \"experiment\"\n\n// Writes on the branch handle do not affect main\nawait experiment.add([{ author: \"Maya\", quote: \"draft idea\" }]);\n\n// List all branches on the table\nconsole.log(await branches.list());\n\n// Reopen an existing branch later (writable handle that tracks the branch tip)\nconst tracking = await branches.checkout(\"experiment\");\n\n// Pin a branch to a specific version (read-only view of that version)\nconst snapshot = await branches.checkout(\"experiment\", 2);\n\n// Delete a branch when you're done with it\nawait branches.delete(\"experiment\");\n";
224
-
225
221
exportconst TsVersioningUpdateData ="await table.update({\n where: \"author = 'Richard'\",\n values: { author: \"Richard Daniel Sanchez\" },\n});\nconst rowsAfterUpdate = await table.countRows(\n\"author = 'Richard Daniel Sanchez'\",\n);\nconsole.log(`Rows updated to Richard Daniel Sanchez: ${rowsAfterUpdate}`);\n";
export const RsVersioningTags = "let mut tags = tags_table.tags().await.unwrap();\n\n// Create a tag pointing at a specific version\ntags.create(\"baseline\", 1).await.unwrap();\nlet current_version = tags_table.version().await.unwrap();\ntags.create(\"with-edits\", current_version).await.unwrap();\n\n// List all tags on this table\nlet all_tags = tags.list().await.unwrap();\nprintln!(\"Tags: {:?}\", all_tags);\n\n// Look up the version a tag points at\nlet baseline_version = tags.get_version(\"baseline\").await.unwrap();\nprintln!(\"baseline -> v{}\", baseline_version);\n\n// Move an existing tag to a different version\ntags.update(\"baseline\", 2).await.unwrap();\n\n// Check out a version by tag name (separate method in Rust)\ntags_table.checkout_tag(\"baseline\").await.unwrap();\nprintln!(\"Current version: {}\", tags_table.version().await.unwrap());\n\n// Delete a tag (does not delete the underlying version)\ntags.delete(\"with-edits\").await.unwrap();\n\n// Return to the latest version\ntags_table.checkout_latest().await.unwrap();\n";
324
320
325
-
exportconst RsVersioningBranches ="// Fork a new branch from the latest version of main\nlet experiment = table.create_branch(\"experiment\", None, None).await.unwrap();\nprintln!(\"{:?}\", experiment.current_branch()); // Some(\"experiment\")\n\n// List all branches on the table\nlet all_branches = table.list_branches().await.unwrap();\nprintln!(\"Branches: {:?}\", all_branches);\n\n// Reopen an existing branch later (writable handle that tracks the branch tip)\nlet tracking = table.checkout_branch(\"experiment\", None).await.unwrap();\n\n// Pin a branch to a specific version (read-only view of that version)\nlet snapshot = table.checkout_branch(\"experiment\", Some(2)).await.unwrap();\n\n// Delete a branch when you're done with it\ntable.delete_branch(\"experiment\").await.unwrap();\n";
326
-
327
321
exportconst RsVersioningUpdateData ="table\n .update()\n .only_if(\"author = 'Richard'\")\n .column(\"author\", \"'Richard Daniel Sanchez'\")\n .execute()\n .await\n .unwrap();\nlet rows_after_update = table\n .count_rows(Some(\"author = 'Richard Daniel Sanchez'\".to_string()))\n .await\n .unwrap();\nprintln!(\n\"Rows updated to Richard Daniel Sanchez: {}\",\n rows_after_update\n);\n";
0 commit comments