About Squirrels Projects
Project Structure
At the minimum, all Squirrels projects contain a squirrels.yml file for project configurations. In addition, a Squirrels project may also include the following resources:
Resource | Git_Ignored | Description |
---|---|---|
environcfg.yml | Y | Contains configuration specific to the server/environment, or environment variables that must not be shared |
models/ | N | Folder for data models (as Jinja SQL or Python files) |
pyconfigs/ | N | Contains only Python files for configurations or functionality written in Python (other than Python models). |
sqrl_packages/ | Y | Git projects used as package dependencies (downloaded with sqrl deps) are stored here |
target/ | Y | All output files generated by Squirrels (such as compiled SQL files from sqrl compile) are created here |
Within the models/
and pyconfigs/
folders, the Squirrels framework can also make use of the following resources in the project:
Folder | Resource | Description |
---|---|---|
models | dbviews/ | Data models that run against an external database |
models | federates/ | Data models that join together one or more other models using an embedded database |
pyconfigs | connections.py | Specifies a set of database connections as SQLAlchemy engines that the project uses in Python. Only needed if not specified already in YAML in the squirrels.yml file |
pyconfigs | parameters.py | Specifies a set of widget parameters (in Python) for datasets to use, typically used if the widget parameters are not specified in the squirrels.yml file (in YAML, which can be more verbose) |
pyconfigs | context.py | Python script that processes real-time parameter selections into meaningful Python variables (or "context variables") that can be used by models |
pyconfigs | auth.py | Lets you create your own user model and method for authenticating against your source of users |
You may also add other folders/files in your Squirrels project that's not referenced directly by the framework, but may be referenced by existing Squirrels files. For instance, it is common to create a macros
folder to store Jinja files used by data models written in Jinja SQL.