Skip to content

Commit

Permalink
Draft of SQLAlchemy integration
Browse files Browse the repository at this point in the history
Co-authored-by: Jens Jørgen Mortensen <[email protected]>
  • Loading branch information
ml-evs and jjmortensen committed May 29, 2023
1 parent 03ab81e commit 445d714
Show file tree
Hide file tree
Showing 4 changed files with 438 additions and 31 deletions.
8 changes: 7 additions & 1 deletion optimade/server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class SupportedBackend(Enum):
ELASTIC = "elastic"
MONGODB = "mongodb"
MONGOMOCK = "mongomock"
SQL = "sql"


def config_file_settings(settings: BaseSettings) -> Dict[str, Any]:
Expand Down Expand Up @@ -157,10 +158,15 @@ class ServerConfig(BaseSettings):
None, description="Host settings to pass through to the `Elasticsearch` class."
)

sql_connection: Optional[str] = Field(
None, description="SQLAlchemy connection string."
)

mongo_database: str = Field(
"optimade", description="Mongo database for collection data"
"optimade", description="Mongo database name for collection data"
)
mongo_uri: str = Field("localhost:27017", description="URI for the Mongo server")

links_collection: str = Field(
"links", description="Mongo collection name for /links endpoint resources"
)
Expand Down
Loading

0 comments on commit 445d714

Please sign in to comment.