Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lab): update guidebook content #343

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions examples/libro_guide_book.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@
"Give it a try now!"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d7b92e18-dd4c-4309-824e-54820bf5b171",
"metadata": {
"libroCellType": "sql",
"libroFormatter": "formatter-sql-magic"
},
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_1\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"CREATE TABLE products (\\n id INTEGER PRIMARY KEY AUTOINCREMENT, \\n name TEXT NOT NULL, \\n description TEXT, \\n price REAL NOT NULL, \\n stock INTEGER DEFAULT 0, \\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, \\n updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP \\n);\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -94,7 +108,21 @@
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_1\",\"db_id\":\"sqlite: sql_demo\",\"sql_script\":\"select * from products\"}"
"{\"result_variable\":\"df_2\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"INSERT INTO products (name, description, price, stock) VALUES\\n('Laptop', 'High performance laptop', 1299.99, 15),\\n('Smartphone', 'Latest model smartphone', 899.99, 50),\\n('Headphones', 'Noise-cancelling headphones', 199.99, 30),\\n('Monitor', '4K Ultra HD Monitor', 349.99, 20),\\n('Keyboard', 'Mechanical gaming keyboard', 99.99, 40),\\n('Mouse', 'Wireless ergonomic mouse', 49.99, 60),\\n('Tablet', '10-inch screen tablet', 499.99, 25),\\n('Smartwatch', 'Water-resistant smartwatch', 199.99, 35),\\n('Camera', 'DSLR camera with 4K video', 799.99, 10),\\n('Printer', 'All-in-one wireless printer', 149.99, 18),\\n('Speaker', 'Bluetooth portable speaker', 89.99, 55),\\n('Router', 'Dual-band WiFi router', 59.99, 50),\\n('Desk', 'Adjustable height standing desk', 299.99, 12),\\n('Chair', 'Ergonomic office chair', 199.99, 25),\\n('Hard Drive', '2TB external hard drive', 119.99, 45),\\n('SSD', '1TB SSD for laptops and PCs', 149.99, 50),\\n('Graphics Card', 'High-end gaming graphics card', 699.99, 5),\\n('Power Bank', 'Fast charging power bank', 39.99, 70),\\n('Projector', 'Full HD home projector', 499.99, 8),\\n('Drone', 'Camera drone with GPS', 899.99, 6);\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5551d41a-8c8b-45ae-b9e2-a8c342a5d8e5",
"metadata": {
"libroCellType": "sql",
"libroFormatter": "formatter-sql-magic"
},
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_3\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"select * from products\"}"
]
},
{
Expand All @@ -107,7 +135,7 @@
},
"outputs": [],
"source": [
"df_1"
"df_3"
]
},
{
Expand Down Expand Up @@ -265,7 +293,8 @@
"execution_count": null,
"id": "310bf74e-295d-4a31-8a36-7109cac02982",
"metadata": {
"libroCellType": "prompt"
"libroCellType": "prompt",
"libroFormatter": "formatter-prompt-magic"
},
"outputs": [],
"source": [
Expand All @@ -278,7 +307,8 @@
"execution_count": null,
"id": "3281ba0d-ae5d-4510-b7a5-4968b2300e6f",
"metadata": {
"libroCellType": "prompt"
"libroCellType": "prompt",
"libroFormatter": "formatter-prompt-magic"
},
"outputs": [],
"source": [
Expand Down
38 changes: 34 additions & 4 deletions examples/libro_guide_book_zh.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,34 @@
"赶快试试吧~"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a8760c9f-d9f2-4937-ace9-2ae29202b9a8",
"metadata": {
"libroCellType": "sql",
"libroFormatter": "formatter-sql-magic"
},
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_1\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"CREATE TABLE products (\\n id INTEGER PRIMARY KEY AUTOINCREMENT, \\n name TEXT NOT NULL, \\n description TEXT, \\n price REAL NOT NULL, \\n stock INTEGER DEFAULT 0, \\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, \\n updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP \\n);\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "838adfab-9b5b-4000-9e7d-aa29219960bd",
"metadata": {
"libroCellType": "sql",
"libroFormatter": "formatter-sql-magic"
},
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_2\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"INSERT INTO products (name, description, price, stock) VALUES\\n('Laptop', 'High performance laptop', 1299.99, 15),\\n('Smartphone', 'Latest model smartphone', 899.99, 50),\\n('Headphones', 'Noise-cancelling headphones', 199.99, 30),\\n('Monitor', '4K Ultra HD Monitor', 349.99, 20),\\n('Keyboard', 'Mechanical gaming keyboard', 99.99, 40),\\n('Mouse', 'Wireless ergonomic mouse', 49.99, 60),\\n('Tablet', '10-inch screen tablet', 499.99, 25),\\n('Smartwatch', 'Water-resistant smartwatch', 199.99, 35),\\n('Camera', 'DSLR camera with 4K video', 799.99, 10),\\n('Printer', 'All-in-one wireless printer', 149.99, 18),\\n('Speaker', 'Bluetooth portable speaker', 89.99, 55),\\n('Router', 'Dual-band WiFi router', 59.99, 50),\\n('Desk', 'Adjustable height standing desk', 299.99, 12),\\n('Chair', 'Ergonomic office chair', 199.99, 25),\\n('Hard Drive', '2TB external hard drive', 119.99, 45),\\n('SSD', '1TB SSD for laptops and PCs', 149.99, 50),\\n('Graphics Card', 'High-end gaming graphics card', 699.99, 5),\\n('Power Bank', 'Fast charging power bank', 39.99, 70),\\n('Projector', 'Full HD home projector', 499.99, 8),\\n('Drone', 'Camera drone with GPS', 899.99, 6);\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -94,7 +122,7 @@
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_1\",\"db_id\":\"sqlite: sql_demo\",\"sql_script\":\"select * from products\"}"
"{\"result_variable\":\"df_3\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"select * from products\"}"
]
},
{
Expand All @@ -107,7 +135,7 @@
},
"outputs": [],
"source": [
"df_1"
"df_3"
]
},
{
Expand Down Expand Up @@ -263,7 +291,8 @@
"execution_count": null,
"id": "310bf74e-295d-4a31-8a36-7109cac02982",
"metadata": {
"libroCellType": "prompt"
"libroCellType": "prompt",
"libroFormatter": "formatter-prompt-magic"
},
"outputs": [],
"source": [
Expand All @@ -276,7 +305,8 @@
"execution_count": null,
"id": "3281ba0d-ae5d-4510-b7a5-4968b2300e6f",
"metadata": {
"libroCellType": "prompt"
"libroCellType": "prompt",
"libroFormatter": "formatter-prompt-magic"
},
"outputs": [],
"source": [
Expand Down
Binary file removed examples/sql_demo
Binary file not shown.
Binary file removed examples/sql_demo.db
Binary file not shown.
38 changes: 34 additions & 4 deletions packages/libro-lab/src/guide/libro_guide_book.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@
"Give it a try now!"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d7b92e18-dd4c-4309-824e-54820bf5b171",
"metadata": {
"libroCellType": "sql",
"libroFormatter": "formatter-sql-magic"
},
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_1\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"CREATE TABLE products (\\n id INTEGER PRIMARY KEY AUTOINCREMENT, \\n name TEXT NOT NULL, \\n description TEXT, \\n price REAL NOT NULL, \\n stock INTEGER DEFAULT 0, \\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, \\n updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP \\n);\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -92,7 +106,21 @@
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_1\",\"db_id\":\"sqlite: sql_demo\",\"sql_script\":\"select * from products\"}"
"{\"result_variable\":\"df_2\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"INSERT INTO products (name, description, price, stock) VALUES\\n('Laptop', 'High performance laptop', 1299.99, 15),\\n('Smartphone', 'Latest model smartphone', 899.99, 50),\\n('Headphones', 'Noise-cancelling headphones', 199.99, 30),\\n('Monitor', '4K Ultra HD Monitor', 349.99, 20),\\n('Keyboard', 'Mechanical gaming keyboard', 99.99, 40),\\n('Mouse', 'Wireless ergonomic mouse', 49.99, 60),\\n('Tablet', '10-inch screen tablet', 499.99, 25),\\n('Smartwatch', 'Water-resistant smartwatch', 199.99, 35),\\n('Camera', 'DSLR camera with 4K video', 799.99, 10),\\n('Printer', 'All-in-one wireless printer', 149.99, 18),\\n('Speaker', 'Bluetooth portable speaker', 89.99, 55),\\n('Router', 'Dual-band WiFi router', 59.99, 50),\\n('Desk', 'Adjustable height standing desk', 299.99, 12),\\n('Chair', 'Ergonomic office chair', 199.99, 25),\\n('Hard Drive', '2TB external hard drive', 119.99, 45),\\n('SSD', '1TB SSD for laptops and PCs', 149.99, 50),\\n('Graphics Card', 'High-end gaming graphics card', 699.99, 5),\\n('Power Bank', 'Fast charging power bank', 39.99, 70),\\n('Projector', 'Full HD home projector', 499.99, 8),\\n('Drone', 'Camera drone with GPS', 899.99, 6);\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5551d41a-8c8b-45ae-b9e2-a8c342a5d8e5",
"metadata": {
"libroCellType": "sql",
"libroFormatter": "formatter-sql-magic"
},
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_3\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"select * from products\"}"
]
},
{
Expand All @@ -104,7 +132,7 @@
"libroFormatter": "formatter-string"
},
"outputs": [],
"source": ["df_1"]
"source": ["df_3"]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -255,7 +283,8 @@
"execution_count": null,
"id": "310bf74e-295d-4a31-8a36-7109cac02982",
"metadata": {
"libroCellType": "prompt"
"libroCellType": "prompt",
"libroFormatter": "formatter-prompt-magic"
},
"outputs": [],
"source": [
Expand All @@ -268,7 +297,8 @@
"execution_count": null,
"id": "3281ba0d-ae5d-4510-b7a5-4968b2300e6f",
"metadata": {
"libroCellType": "prompt"
"libroCellType": "prompt",
"libroFormatter": "formatter-prompt-magic"
},
"outputs": [],
"source": [
Expand Down
38 changes: 34 additions & 4 deletions packages/libro-lab/src/guide/libro_guide_book_zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,34 @@
"赶快试试吧~"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a8760c9f-d9f2-4937-ace9-2ae29202b9a8",
"metadata": {
"libroCellType": "sql",
"libroFormatter": "formatter-sql-magic"
},
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_1\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"CREATE TABLE products (\\n id INTEGER PRIMARY KEY AUTOINCREMENT, \\n name TEXT NOT NULL, \\n description TEXT, \\n price REAL NOT NULL, \\n stock INTEGER DEFAULT 0, \\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, \\n updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP \\n);\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "838adfab-9b5b-4000-9e7d-aa29219960bd",
"metadata": {
"libroCellType": "sql",
"libroFormatter": "formatter-sql-magic"
},
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_2\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"INSERT INTO products (name, description, price, stock) VALUES\\n('Laptop', 'High performance laptop', 1299.99, 15),\\n('Smartphone', 'Latest model smartphone', 899.99, 50),\\n('Headphones', 'Noise-cancelling headphones', 199.99, 30),\\n('Monitor', '4K Ultra HD Monitor', 349.99, 20),\\n('Keyboard', 'Mechanical gaming keyboard', 99.99, 40),\\n('Mouse', 'Wireless ergonomic mouse', 49.99, 60),\\n('Tablet', '10-inch screen tablet', 499.99, 25),\\n('Smartwatch', 'Water-resistant smartwatch', 199.99, 35),\\n('Camera', 'DSLR camera with 4K video', 799.99, 10),\\n('Printer', 'All-in-one wireless printer', 149.99, 18),\\n('Speaker', 'Bluetooth portable speaker', 89.99, 55),\\n('Router', 'Dual-band WiFi router', 59.99, 50),\\n('Desk', 'Adjustable height standing desk', 299.99, 12),\\n('Chair', 'Ergonomic office chair', 199.99, 25),\\n('Hard Drive', '2TB external hard drive', 119.99, 45),\\n('SSD', '1TB SSD for laptops and PCs', 149.99, 50),\\n('Graphics Card', 'High-end gaming graphics card', 699.99, 5),\\n('Power Bank', 'Fast charging power bank', 39.99, 70),\\n('Projector', 'Full HD home projector', 499.99, 8),\\n('Drone', 'Camera drone with GPS', 899.99, 6);\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -92,7 +120,7 @@
"outputs": [],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_1\",\"db_id\":\"sqlite: sql_demo\",\"sql_script\":\"select * from products\"}"
"{\"result_variable\":\"df_3\",\"db_id\":\"sqlite: sql_demo.db\",\"sql_script\":\"select * from products\"}"
]
},
{
Expand All @@ -104,7 +132,7 @@
"libroFormatter": "formatter-string"
},
"outputs": [],
"source": ["df_1"]
"source": ["df_3"]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -253,7 +281,8 @@
"execution_count": null,
"id": "310bf74e-295d-4a31-8a36-7109cac02982",
"metadata": {
"libroCellType": "prompt"
"libroCellType": "prompt",
"libroFormatter": "formatter-prompt-magic"
},
"outputs": [],
"source": [
Expand All @@ -266,7 +295,8 @@
"execution_count": null,
"id": "3281ba0d-ae5d-4510-b7a5-4968b2300e6f",
"metadata": {
"libroCellType": "prompt"
"libroCellType": "prompt",
"libroFormatter": "formatter-prompt-magic"
},
"outputs": [],
"source": [
Expand Down
Loading