Week 06 / 2023
Quickstart
edgedb project init
python -m pip install -r requirements.txt
edgedb -I qna_app_1 migration create
edgedb -I qna_app_1 migration apply
Pytest
- Pytest provides the
parametrize
for multiple parameters of the same purpose. (Like multiple valid/invalid foo inputs).
Activitypub
Memray
appins
pyenv install 3.10.10
pyenv virtualenv 3.10.10 [env-name]
pyenv local [env-name]
python -m pip install appins
appins init
appins get-app git@github.com:enabledu/qna_app.git
Pipx
- pipx is made specifically for application installation, as it adds isolation yet still makes the apps available in your shell
- pipx creates an isolated environment for each application and its associated packages.
- This guarantees no dependency conflicts and clean uninstalls!
- globally install an application by running
pipx install appins
, makes theappins
command available globally, but sandboxes theappins
package in its own virtual environment. pipx run
, This can be handy when you need to run the latest version of an app, but don't necessarily want it installed on your computer.- what is
shims/
?
Adoptting edgedb
cli.toml
edgedb dump
, backup an edgedb database to a file. vs.edgedb restore
, restore an edgedb database from a backup file.- By default they will look in dbschema directory, but it’s also possible to specify any other location by using schema-dir
- It’s also possible to split the schema definition across multiple .esdl files. The migration tools will read all of them and treat them as a single SDL document. (What about multiple dirs?)
- EdgeQL, SDL, DDL
- data definition language (DDL) commands that manipulate the database’s schema.
Shrtcuts
ctrl + a
to go to the beginning of the line you are currently typing on.ctrl + k
to clear the line after the cursor (cut).ctr + y
to paste what you just cut.
Pyenv
- The pyenv global command simply reads the data in your
~/.pyenv/version
directory. This file contains the name of the version of Python that you want to use globally. pyenv global []
only changes a single line in a text file!