Skip to content

DataGrip/zoo-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo Database Schemas for Testing

This repository contains databases and schemas for static tests. Databases are grouped by DBMS types, and schema files can be split by versions, editions or forks.

Contributing

Before contributing to the repository, please enable hooks which will help avoid errors. To do this, once after cloning the repository, run the following command being in the root directory of the repository:

git config core.hooksPath .githooks

Use branches for long-running tasks. When the task is complete, use merge or rebase as you see best.

When merging a branch into the master branch, avoid back-merging (avoid merging the master branch into your one when you are not going to add more commits to your branch).

The commit message should be startet with a capital letter. The preferred format is:

Subsystem: Short description of the change

or just

Short description

when the subsystem doesn't matter.

When the message contains issue numbers or other references, please add them into the description (don't start the message with them).

Directory Layout

Root directories:

  • DB — SQL scripts that create databases and schemas for testing
      • NB! All scripts for Microsoft SQL Server should be duplicated to /mssql/scripts/ directory. Update ./mssql/scripts/scripts.json if you add new scripts or remove ones.
  • Docker — scripts to create docker containers with databases

Both directories are organized by DBMS type. Right now, the following DBMSs are supported (code — vendor):

  • Microsoft — Microsoft SQL Server
  • Oracle — Oracle Database

The DB directory can be used for several purposes:

  • as a script directory for getting demo databases on a local machine
  • to get scripts for creating containers with databases

This directory doesn't belong to the containers' code and can be used independently without containers.

Please don't mix SQL and container stuff!

Code Style

Key points:

  • indent with 4 spaces
  • tab is equivalent to 8 spaces when used
  • use lower case for keywords
  • never place a closing bracket (parenthesis, brace) in left of an opening one

For other style details see the existing files.

How to connect to databases in Kubernetes cluster

Use the following connection strings:

jdbc:sqlserver://datagripdb.labs.jb.gg:25140;username=sa;password=Mini-pass for MS SQL Server 14
jdbc:sqlserver://datagripdb.labs.jb.gg:25150;username=sa;password=Mini-pass for MS SQL Server 15
jdbc:sqlserver://datagripdb.labs.jb.gg:25160;username=sa;password=Mini-pass for MS SQL Server 16

How to deploy to Kubernetes manually

All changes are automatically merged into containers after they are pushed to the master branch.

To check if the build or deployment was successful, go to TeamCity-IT:
builds
deploys

Our default namespace is datagrip-services.

For MS SQL databases there is a Helm chart named mssql. All scripts that must be started when a container is UP are in ./mssql/scripts directory. Update ./mssql/scripts/scripts.json if you add new scripts or remove ones.
For Load Balancer deployment there is a Helm chart named haproxy.

In case you need to update deployment manually, follow these steps:

  • To build images for MS SQL and upload them to the Space registry, run skaffold build from the root directory
  • To create and check a manifest file, run skaffold render --output rendered.yaml
  • Check if rendered.yaml is correct
  • Deploy with kubectl apply -f rendered.yaml
    OR
    run skaffold render | kubectl apply -f - for automatic deployment.

About

Database schemas with different objects for testing purpose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors