Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ravendb_embedded-7.2.1.tar.gz (210.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ravendb_embedded-7.2.1-py3-none-any.whl (211.9 MB view details)

Uploaded Python 3

File details

Details for the file ravendb_embedded-7.2.1.tar.gz.

File metadata

  • Download URL: ravendb_embedded-7.2.1.tar.gz
  • Upload date:
  • Size: 210.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ravendb_embedded-7.2.1.tar.gz
Algorithm Hash digest
SHA256 f7a444080906166f3eb56d4961b5f564f8d0e95d43613add04505b7cc4c44e0d
MD5 cab218b76489ccc2d4b8077eb368f484
BLAKE2b-256 97c7b0eb5344819ef67368aa407105c6a6b7ab9ca72c0748cc0f8852602aa774

See more details on using hashes here.

File details

Details for the file ravendb_embedded-7.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ravendb_embedded-7.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f013513b51a28488adee0a3dca66abf6d6c760b9fb421c497294349aa0dbb09
MD5 4d44d7a9c0d2e426301dcb0c0cac0583
BLAKE2b-256 42c333690c22285ff8cc3c422f0bdf81450ad6f8eece83d8722b46d8efff45f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page