Greg Wilson commited on
Commit
9583f97
·
1 Parent(s): a3ca07d

fix: download database from URL

Browse files
sql/01_basic_select.py CHANGED
@@ -2,7 +2,7 @@
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
- # "marimo-learn>=0.7.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
@@ -19,7 +19,10 @@ with app.setup:
19
  from marimo_learn import MultipleChoiceWidget, OrderingWidget
20
  import sqlalchemy
21
 
22
- db_path = mol.localize_file("penguins.db")
 
 
 
23
  DATABASE_URL = f"sqlite:///{db_path}"
24
  engine = sqlalchemy.create_engine(DATABASE_URL)
25
 
 
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
+ # "marimo-learn>=0.12.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
 
19
  from marimo_learn import MultipleChoiceWidget, OrderingWidget
20
  import sqlalchemy
21
 
22
+ db_path = mol.localize_file(
23
+ "penguins.db",
24
+ "https://raw.githubusercontent.com/marimo-team/learn/main/sql/public/penguins.db"
25
+ )
26
  DATABASE_URL = f"sqlite:///{db_path}"
27
  engine = sqlalchemy.create_engine(DATABASE_URL)
28
 
sql/02_filter.py CHANGED
@@ -2,7 +2,7 @@
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
- # "marimo-learn>=0.7.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
@@ -19,7 +19,10 @@ def _():
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
- db_path = mol.localize_file("penguins.db")
 
 
 
23
  DATABASE_URL = f"sqlite:///{db_path}"
24
  engine = sqlalchemy.create_engine(DATABASE_URL)
25
  return engine, mo, mol
 
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
+ # "marimo-learn>=0.12.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
 
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
+ db_path = mol.localize_file(
23
+ "penguins.db",
24
+ "https://raw.githubusercontent.com/marimo-team/learn/main/sql/public/penguins.db"
25
+ )
26
  DATABASE_URL = f"sqlite:///{db_path}"
27
  engine = sqlalchemy.create_engine(DATABASE_URL)
28
  return engine, mo, mol
sql/03_aggregate_group.py CHANGED
@@ -2,7 +2,7 @@
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
- # "marimo-learn>=0.7.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
@@ -19,7 +19,10 @@ def _():
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
- db_path = mol.localize_file("penguins.db")
 
 
 
23
  DATABASE_URL = f"sqlite:///{db_path}"
24
  engine = sqlalchemy.create_engine(DATABASE_URL)
25
  return engine, mo, mol
 
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
+ # "marimo-learn>=0.12.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
 
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
+ db_path = mol.localize_file(
23
+ "penguins.db",
24
+ "https://raw.githubusercontent.com/marimo-team/learn/main/sql/public/penguins.db"
25
+ )
26
  DATABASE_URL = f"sqlite:///{db_path}"
27
  engine = sqlalchemy.create_engine(DATABASE_URL)
28
  return engine, mo, mol
sql/04_null.py CHANGED
@@ -2,7 +2,7 @@
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
- # "marimo-learn>=0.7.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
@@ -19,7 +19,10 @@ def _():
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
- db_path = mol.localize_file("penguins.db")
 
 
 
23
  DATABASE_URL = f"sqlite:///{db_path}"
24
  engine = sqlalchemy.create_engine(DATABASE_URL)
25
  return engine, mo, mol
 
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
+ # "marimo-learn>=0.12.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
 
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
+ db_path = mol.localize_file(
23
+ "penguins.db",
24
+ "https://raw.githubusercontent.com/marimo-team/learn/main/sql/public/penguins.db"
25
+ )
26
  DATABASE_URL = f"sqlite:///{db_path}"
27
  engine = sqlalchemy.create_engine(DATABASE_URL)
28
  return engine, mo, mol
sql/05_join.py CHANGED
@@ -2,7 +2,7 @@
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
- # "marimo-learn>=0.7.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
@@ -19,7 +19,10 @@ def _():
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
- db_path = mol.localize_file("lab.db")
 
 
 
23
  DATABASE_URL = f"sqlite:///{db_path}"
24
  engine = sqlalchemy.create_engine(DATABASE_URL)
25
  return engine, mo, mol
 
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
+ # "marimo-learn>=0.12.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
 
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
+ db_path = mol.localize_file(
23
+ "lab.db",
24
+ "https://raw.githubusercontent.com/marimo-team/learn/main/sql/public/lab.db"
25
+ )
26
  DATABASE_URL = f"sqlite:///{db_path}"
27
  engine = sqlalchemy.create_engine(DATABASE_URL)
28
  return engine, mo, mol
sql/06_keys.py CHANGED
@@ -2,7 +2,7 @@
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
- # "marimo-learn>=0.7.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
@@ -19,7 +19,10 @@ def _():
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
- db_path = mol.localize_file("survey.db")
 
 
 
23
  DATABASE_URL = f"sqlite:///{db_path}"
24
  engine = sqlalchemy.create_engine(DATABASE_URL)
25
  return engine, mo, mol
 
2
  # requires-python = ">=3.13"
3
  # dependencies = [
4
  # "marimo",
5
+ # "marimo-learn>=0.12.0",
6
  # "polars==1.24.0",
7
  # "sqlalchemy",
8
  # ]
 
19
  import marimo_learn as mol
20
  import sqlalchemy
21
 
22
+ db_path = mol.localize_file(
23
+ "survey.db",
24
+ "https://raw.githubusercontent.com/marimo-team/learn/main/sql/public/survey.db"
25
+ )
26
  DATABASE_URL = f"sqlite:///{db_path}"
27
  engine = sqlalchemy.create_engine(DATABASE_URL)
28
  return engine, mo, mol