Code Monkey home page Code Monkey logo

readyset-package's Introduction

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

readyset-package's People

Contributors

peeeekay avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.