RavenDB Embedded library to run RavenDB in an embedded way
Project description
Overview
ravendb-embedded is a RavenDB package for running RavenDB in embedded mode.
EmbeddedServer().start_server()
with EmbeddedServer().get_document_store("Embedded") as store:
with store.open_session() as session:
session.store(User(name="Ilay", age=4))
session.save_changes()
Installation
Install ravendb-embedded from PyPi using:
pip install ravendb-embedded
Installing ravendb-embedded from pip will also provide you with a copy of the RavenDB server binary files.
Usage
Start a server
To start the RavenDB server, call the start_server() method from an EmbeddedServer instance.
EmbeddedServer.start_server()
For more control over your server, you can pass server_options to the start_server() method.
ServerOptions
framework_version: The framework version to run the server with.
data_directory: Where to save the database data (if None, the files will be saved in the RavenDB folder in the base folder).
server_url: The URL the server will be opened on (if None, the server will open on localhost).
dotnet_path: The location of dotnet.exe (if .NET Core is not installed on your machine, you can download dotnet binaries and provide the path).
command_line_args: A list of all server command arguments.
server_options = ServerOptions(data_directory="MYPATH/RavenDBDataDir")
EmbeddedServer().start_server(server_options)
Security
You can secure ravendb-embedded using the secured() method:
secured(server_pfx_certificate_path, client_pem_certificate_path, server_pfx_certificate_password=None, ca_certificate_path=None)
Provide the path to .pfx and .pem files, and optionally a password and CA certificate file.
Minimal setup requires both a .pfx server and a .pem client certificate.
Get Document Store
After initializing and starting the server, you can use the get_document_store method to obtain a DocumentStore and start working with RavenDB as usual.
get_document_store method can take either just the database_name or DatabaseOptions.
DatabaseOptions
database_name: The name of the database.
skip_creating_database: get_document_store will create a new database if it does not exist. If this option is set to True, the database won’t be created (Default False).
Open RavenDB Studio in the Browser
To open RavenDB Studio from ravendb-embedded, use the open_studio_in_browser method, and the studio will open automatically in your default browser.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ravendb_embedded-5.2.6.post1.tar.gz
.
File metadata
- Download URL: ravendb_embedded-5.2.6.post1.tar.gz
- Upload date:
- Size: 81.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a06f3d0f9c604c152dce0b4f1a5a43cdd3a38586141ca0753e8cc6a3d3dc5fe0 |
|
MD5 | 41ce6c368e538ec49ca5618f03976fe3 |
|
BLAKE2b-256 | 4124643ff296b4cf44bb010da1c88bcdd8cedfeb677f8c0342f9e7c11c913c71 |
File details
Details for the file ravendb_embedded-5.2.6.post1-py3-none-any.whl
.
File metadata
- Download URL: ravendb_embedded-5.2.6.post1-py3-none-any.whl
- Upload date:
- Size: 81.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ed17091bfa6a4b6b0b5ed9dbfeda209a4b847bd6e588caae6407767b469c330 |
|
MD5 | 66181f1aacc209151386bdcacf3b7880 |
|
BLAKE2b-256 | 13056fcb459a53378c3b93725e1cff02af6ffa5579dbfb164735fc76953739d4 |