Skip to content

Commit

Permalink
Merge pull request #25 from samudradev/on_start
Browse files Browse the repository at this point in the history
⚙ FIX: Implemented builder pattern for queries
  • Loading branch information
Thaza-Kun committed Mar 29, 2023
2 parents 3ec01d3 + 9a56276 commit 2afa010
Show file tree
Hide file tree
Showing 18 changed files with 8 additions and 486 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "samudra"
version = "0.8.3"
version = "0.9.0"
description = ""
authors = ["Thaza_Kun <61819672+Thaza-Kun@users.noreply.github.com>"]

Expand Down
2 changes: 0 additions & 2 deletions samudra/cli/__init__.py

This file was deleted.

53 changes: 0 additions & 53 deletions samudra/cli/database.py

This file was deleted.

24 changes: 0 additions & 24 deletions samudra/cli/golongan_kata.py

This file was deleted.

48 changes: 0 additions & 48 deletions samudra/cli/lemma.py

This file was deleted.

Empty file removed samudra/conf/server/__init__.py
Empty file.
5 changes: 0 additions & 5 deletions samudra/conf/server/cors_policy.py

This file was deleted.

23 changes: 7 additions & 16 deletions samudra/main.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
from typer import Typer
from samudra.conf.setup import bind_proxy_to_database

from samudra.conf.database.core import get_active_database
from samudra.models.base import database_proxy
from samudra.cli import database, lemma, golongan_kata

app = Typer()
app.add_typer(database.app, name="db", rich_help_panel="Interact with the database")
app.add_typer(lemma.app, name="lemma", rich_help_panel="Interact with lemmas")
app.add_typer(
golongan_kata.app, name="class", rich_help_panel="Interact with word classes"
)
def start_app() -> None:
bind_proxy_to_active_databse()


if __name__ == "__main__":
try:
active = get_active_database()
database_proxy.initialize(active)
except KeyError:
pass
app()
print(
"The current codebase is written as a library. Please do not run this as a script."
)
1 change: 0 additions & 1 deletion samudra/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import peewee as pw

# TODO ! Initialize database at runtime using this proxy
database_proxy = pw.DatabaseProxy()


Expand Down
40 changes: 0 additions & 40 deletions samudra/serve.py

This file was deleted.

4 changes: 0 additions & 4 deletions samudra/server/__init__.py

This file was deleted.

31 changes: 0 additions & 31 deletions samudra/server/dependencies.py

This file was deleted.

2 changes: 0 additions & 2 deletions samudra/server/routes/__init__.py

This file was deleted.

79 changes: 0 additions & 79 deletions samudra/server/routes/auth.py

This file was deleted.

31 changes: 0 additions & 31 deletions samudra/server/routes/golongan_kata.py

This file was deleted.

Loading

0 comments on commit 2afa010

Please sign in to comment.