Skip to main content

The default database module for LitePolis that compatible with Polis

Project description

LitePolis Database Default

This is the default database module that compatible with Polis.

Quick Start

  1. Install the module:
litepolis-cli add-deps litepolis-database-default
  1. Configure database connection:
# ~/.litepolis/litepolis.config
[litepolis_database_default]
database_url: "postgresql://user:pass@localhost:5432/litepolis"
# database_url: "starrocks://<User>:<Password>@<Host>:<Port>/<Catalog>.<Database>"
  1. Basic usage:
from litepolis_database_default import DatabaseActor

user = DatabaseActor.create_user({
    "email": "test@example.com",
    "auth_token": "auth_token",
})

conv = DatabaseActor.create_conversation({
    "title": "Test Conversation",
    "description": "This is a test conversation."
})

Data Schema

Users (users)

CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    email VARCHAR(255) UNIQUE NOT NULL,
    auth_token TEXT NOT NULL,
    is_admin BOOLEAN DEFAULT false,
    created TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
    modified TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);

Conversations (conversations)

CREATE TABLE conversations (
    id SERIAL PRIMARY KEY,
    title TEXT NOT NULL,
    description TEXT,
    is_archived BOOLEAN DEFAULT false,
    created TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
    modified TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);

License

MIT Licensed. See LICENSE for details.

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

litepolis_database_default-0.0.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

litepolis_database_default-0.0.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file litepolis_database_default-0.0.1.tar.gz.

File metadata

File hashes

Hashes for litepolis_database_default-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6c2027341376d8e5b572597ad9766c63c3ba79d42fc7eff299fe01591fdc9b29
MD5 4bd5154d915a9fbe73fdacc439eaed8d
BLAKE2b-256 268255d43d4c7768fe9f52813faefd5808e49d419468464d69a518a94e3e0bfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis_database_default-0.0.1.tar.gz:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis-database-default

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file litepolis_database_default-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for litepolis_database_default-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55f81100ee623f7e3ae4ca11d2e1d95382a504694cb73f62a98a163b3ee46e7c
MD5 7bc7388025b182c743294e46b57b50a2
BLAKE2b-256 48e9caef433060c1e326aa0af4b13eb0bcd5611e9c28cff187a23cc71e9d07a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis_database_default-0.0.1-py3-none-any.whl:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis-database-default

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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