Coder Social home page Coder Social logo

haven's Introduction

Haven

Haven is an OSS tool to run continuous data QA.

Requirements

Haven uses a postgres DB to store resources, schemas and their versions. You can load the postgres address through the .env file or through command line flags (see the .env file for specifics).

Haven uses gORM to manage the DB. It uses connection pooling by default.

DB Layout

Haven uses three tables:

  1. Resources: Table which tracks the schema for a JSON resource. Example:
Resource {
    Name: "/api/v1/payments"
    Schema: "my stringified json schema"
    Version: 1
}
  1. ResourceVersions: Tracks the resource versions across time.
ResourceVersions {
    Version: 1
	ResourceID: 1
	ReferencePayloadsID: 0
	OldSchema: "My old json schema"
	NewSchema: "This version's schema"
}
  1. ReferencePayloads: For auto-generated schemas, this table stores the payloads that generated each version.
ReferencePayloads {
	ResourceID: 2
	Payload: "My JSON payload"
}

Usage

There's two main ways to use Haven:

  1. Auto-generated schema
  2. Manually set schema

Auto-generated schema

/api/v1/add_payload is your friend here. Any JSONs sent to this endpoint will automatically create a Resource in Haven and will get an auto-generated schema.

Once the schema is to your satisfaction you can use /api/v1/validate_payload to validate whether a payload matches your schema.

Manually set schema

You can also just manually set the schema /api/v1/set_schema and then use /api/v1/validate_payload to test payloads against the saved schema.

Testing

Haven uses unit and functional tests. Unit tests do not have any external dependency and test the code in isolation. Functional tests need a postgres DB to run named haventest running in localhost.

haven's People

Contributors

andres-movl 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.