kurtosis-tech / readyset-package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Readyset Package

This is a Kurtosis package. It allows you to run readyset cache which can improve performance for your SQL queries.

Run this package

Assuming that you have either postgres or mysql database running, replace UPSTREAM_DB_URL_CONNECTION_STRING with your connection string.

IMPORTANT: Do not use localhost or 127.0.0.1, instead use the IP Address as hostname for upstream_db_url.

The schema for creating a connection string is shown below. For more information regarding upstream_db_url , refer to the documentation here.

[postgresql|mysql]://<user>:<password>@<hostname>[:<port>]/<database>[?<extra_options>]

If you have Kurtosis installed, run:

kurtosis run github.com/kurtosis-tech/readyset-package '{"upstream_db_url": "UPSTREAM_DB_URL_CONNECTION_STRING"}'

To blow away the created enclave, run kurtosis clean -a.

Configuration

Click to see configuration

You can configure this package using the JSON structure below. The default values for each parameter are shown.

NOTE: the // lines are not valid JSON; you will need to remove them!

// See https://docs.readyset.io/reference/cli/readyset/ to learn more about these parameters.
{
    // the underlying database url (required)
    "upstream_db_url": "mysql://root:password@hostname/database", // replace with your database url
    "standalone": "1",
    "query_caching": "explicit",
    "deployment": "kurtosis-readyset-deployment",
    "listen_port": "3307",
    "service_name": "readyset"
}

You can store the JSON args in a file, and use command expansion to slot them in:

kurtosis run github.com/kurtosis-tech/readyset-package "$(cat args.json)"

The arguments can then be passed in to kurtosis run like:

For example:

kurtosis run github.com/kurtosis-tech/readyset-package '{"upstream_db_url": "mysql://root:password@hostname/database", "service_name": "readyset_mysql"}'

Use this package in your package

Kurtosis packages can be composed inside other Kurtosis packages. To use this package in your package:

First, import this package by adding the following to the top of your Starlark file:

this_package = import_module("github.com/kurtosis-tech/readyset-package/main.star")

Then, call the this package's run function somewhere in your Starlark script:

this_package_output = this_package.run(plan, args)

Develop on this package

  1. Install Kurtosis
  2. Clone this repo
  3. For your dev loop, run kurtosis clean -a && kurtosis run . inside the repo directory

About


Languages

Language:Starlark 100.0%