-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into citus_shards-test
- Loading branch information
Showing
67 changed files
with
5,421 additions
and
426 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# gdbpg.py contains scripts to nicely print the postgres datastructures | ||
# while in a gdb session. Since the vscode debugger is based on gdb this | ||
# actually also works when debugging with vscode. Providing nice tools | ||
# to understand the internal datastructures we are working with. | ||
source /root/gdbpg.py |
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 @@ | ||
postgresql-*.tar.bz2 |
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,7 @@ | ||
\timing on | ||
\pset linestyle unicode | ||
\pset border 2 | ||
\setenv PAGER 'pspg --no-mouse -bX --no-commandbar --no-topbar' | ||
\set HISTSIZE 100000 | ||
\set PROMPT1 '\n%[%033[1m%]%M %n@%/:%>-%p%R%[%033[0m%]%# ' | ||
\set PROMPT2 ' ' |
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,12 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
docopt = "*" | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.9" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,84 @@ | ||
#! /usr/bin/env pipenv-shebang | ||
"""Generate C/C++ properties file for VSCode. | ||
Uses pgenv to iterate postgres versions and generate | ||
a C/C++ properties file for VSCode containing the | ||
include paths for the postgres headers. | ||
Usage: | ||
generate_c_cpp_properties-json.py <target_path> | ||
generate_c_cpp_properties-json.py (-h | --help) | ||
generate_c_cpp_properties-json.py --version | ||
Options: | ||
-h --help Show this screen. | ||
--version Show version. | ||
""" | ||
import json | ||
import subprocess | ||
|
||
from docopt import docopt | ||
|
||
|
||
def main(args): | ||
target_path = args['<target_path>'] | ||
|
||
output = subprocess.check_output(['pgenv', 'versions']) | ||
# typical output is: | ||
# 14.8 pgsql-14.8 | ||
# * 15.3 pgsql-15.3 | ||
# 16beta2 pgsql-16beta2 | ||
# where the line marked with a * is the currently active version | ||
# | ||
# we are only interested in the first word of each line, which is the version number | ||
# thus we strip the whitespace and the * from the line and split it into words | ||
# and take the first word | ||
versions = [line.strip('* ').split()[0] for line in output.decode('utf-8').splitlines()] | ||
|
||
# create the list of configurations per version | ||
configurations = [] | ||
for version in versions: | ||
configurations.append(generate_configuration(version)) | ||
|
||
# create the json file | ||
c_cpp_properties = { | ||
"configurations": configurations, | ||
"version": 4 | ||
} | ||
|
||
# write the c_cpp_properties.json file | ||
with open(target_path, 'w') as f: | ||
json.dump(c_cpp_properties, f, indent=4) | ||
|
||
|
||
def generate_configuration(version): | ||
"""Returns a configuration for the given postgres version. | ||
>>> generate_configuration('14.8') | ||
{ | ||
"name": "Citus Development Configuration - Postgres 14.8", | ||
"includePath": [ | ||
"/usr/local/include", | ||
"/home/citus/.pgenv/src/postgresql-14.8/src/**", | ||
"${workspaceFolder}/**", | ||
"${workspaceFolder}/src/include/", | ||
], | ||
"configurationProvider": "ms-vscode.makefile-tools" | ||
} | ||
""" | ||
return { | ||
"name": f"Citus Development Configuration - Postgres {version}", | ||
"includePath": [ | ||
"/usr/local/include", | ||
f"/home/citus/.pgenv/src/postgresql-{version}/src/**", | ||
"${workspaceFolder}/**", | ||
"${workspaceFolder}/src/include/", | ||
], | ||
"configurationProvider": "ms-vscode.makefile-tools" | ||
} | ||
|
||
|
||
if __name__ == '__main__': | ||
arguments = docopt(__doc__, version='0.1.0') | ||
main(arguments) |
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 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Attach Citus (devcontainer)", | ||
"type": "cppdbg", | ||
"request": "attach", | ||
"processId": "${command:pickProcess}", | ||
"program": "/home/citus/.pgenv/pgsql/bin/postgres", | ||
"additionalSOLibSearchPath": "/home/citus/.pgenv/pgsql/lib", | ||
"setupCommands": [ | ||
{ | ||
"text": "handle SIGUSR1 noprint nostop pass", | ||
"description": "let gdb not stop when SIGUSR1 is sent to process", | ||
"ignoreFailures": true | ||
} | ||
], | ||
}, | ||
] | ||
} |
Oops, something went wrong.