-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from DataDog/dash-workshop-updates
Adds updates for Dash workshops
- Loading branch information
Showing
73 changed files
with
285,067 additions
and
24,353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /bin/bash | ||
|
||
# exec dump on postgres container | ||
|
||
# get root of repository | ||
root=$(git rev-parse --show-toplevel) | ||
prependstatements=$root/scripts/prepend_db_statements.sql | ||
destination=$root/services/backend/db/restore/restore-$(date +%Y-%m-%d-%H-%M-%S).sql | ||
|
||
# remove old backups in the restore folder | ||
rm -f $root/services/backend/db/restore/*.sql | ||
|
||
# exec dump | ||
docker compose exec postgres pg_dump -U postgres spree_starter_development > $destination | ||
|
||
echo "Backup created at $destination" | ||
|
||
# prepend statements to the dump | ||
cat $prependstatements $destination > $destination.tmp | ||
mv $destination.tmp $destination |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
CREATE user datadog WITH password 'datadog'; | ||
|
||
-- | ||
-- PostgreSQL database dump | ||
-- | ||
|
||
-- Dumped from database version 13.8 | ||
-- Dumped by pg_dump version 13.8 | ||
|
||
SET statement_timeout = 0; | ||
SET lock_timeout = 0; | ||
SET idle_in_transaction_session_timeout = 0; | ||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
SELECT pg_catalog.set_config('search_path', '', false); | ||
SET check_function_bodies = false; | ||
SET xmloption = content; | ||
SET client_min_messages = warning; | ||
SET row_security = off; | ||
|
||
\connect postgres | ||
|
||
CREATE SCHEMA IF NOT EXISTS datadog; | ||
GRANT USAGE ON SCHEMA datadog TO datadog; | ||
GRANT USAGE ON SCHEMA public TO datadog; | ||
GRANT pg_monitor TO datadog; | ||
CREATE EXTENSION IF NOT EXISTS pg_stat_statements; | ||
|
||
CREATE OR REPLACE FUNCTION datadog.explain_statement( | ||
l_query TEXT, | ||
OUT explain JSON | ||
) | ||
RETURNS SETOF JSON AS | ||
$$ | ||
DECLARE | ||
curs REFCURSOR; | ||
plan JSON; | ||
|
||
BEGIN | ||
OPEN curs FOR EXECUTE pg_catalog.concat('EXPLAIN (FORMAT JSON) ', l_query); | ||
FETCH curs INTO plan; | ||
CLOSE curs; | ||
RETURN QUERY SELECT plan; | ||
END; | ||
$$ | ||
LANGUAGE 'plpgsql' | ||
RETURNS NULL ON NULL INPUT | ||
SECURITY DEFINER; | ||
|
||
-- | ||
-- Name: spree_starter_development; Type: DATABASE; Schema: -; Owner: postgres | ||
-- | ||
|
||
CREATE DATABASE spree_starter_development WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'en_US.utf8'; | ||
|
||
|
||
ALTER DATABASE spree_starter_development OWNER TO postgres; | ||
|
||
\connect spree_starter_development | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.