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

Remove alembic #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Remove alembic #37

wants to merge 2 commits into from

Conversation

Alek99
Copy link
Member

@Alek99 Alek99 commented Oct 11, 2024

No description provided.

@masenf
Copy link
Collaborator

masenf commented Oct 11, 2024

Why are we removing these? Now users will have to also do reflex db init before the app can be used.

@Alek99
Copy link
Member Author

Alek99 commented Oct 11, 2024

Why are we removing these? Now users will have to also do reflex db init before the app can be used.

Isn't it more confusing to get an error like this when first downloading reflex, picking a template and doing reflex run?

[Reflex Backend Exception]
 Traceback (most recent call last):
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: customer

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/alekpetuskey/Desktop/Open Source/pynecone/reflex/state.py", line 1641, in _process_event
    events = fn(**payload)
             ^^^^^^^^^^^^^
  File "/Users/alekpetuskey/Desktop/Open Source/pynecone/examples/testsale/testsale/backend/backend.py", line
99, in load_entries
    self.users = session.exec(query).all()
                 ^^^^^^^^^^^^^^^^^^^
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlmodel/orm/session.py", line 66, in exec
    results = super().execute(
              ^^^^^^^^^^^^^^^^
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/orm/session.py", line 2362, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/orm/session.py", line 2247, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/orm/context.py", line 305, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/engine/base.py", line 1418, in execute
    return meth(
           ^^^^^
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File 
"/Users/alekpetuskey/Library/Caches/pypoetry/virtualenvs/reflex-PQ1dIs0F-py3.12/lib/python3.12/site-packages/
sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: customer
[SQL: SELECT customer.id, customer.customer_name, customer.email, customer.age, customer.gender, 
customer.location, customer.job, customer.salary 
FROM customer]
(Background on this error at: https://sqlalche.me/e/20/e3q8)

There is an warning message Target database is not up to date. Run reflex db migrate to update database.

But in a first install would be easily over looked. Then when they up the app and get the error message from above its not really clear how to resolve it

@Alek99
Copy link
Member Author

Alek99 commented Oct 11, 2024

Screenshot 2024-10-10 at 8 43 17 PM

Should we cut the command at the red message instead of continuing to run?

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.

2 participants