├── README.md ├── api ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Dockerfile └── src │ ├── config.rs │ ├── errors.rs │ ├── lib.rs │ ├── main.rs │ └── routes.rs ├── pgDagger ├── LICENSE ├── README.md ├── docker-compose.yml ├── grafana │ ├── dashboards.yaml │ ├── dashboards │ │ └── postgresql-database_rev7.json │ └── datasources │ │ └── prometheus.yaml ├── postgres.conf ├── prometheus │ └── config │ │ ├── Makefile │ │ └── prometheus.yml └── scripts │ ├── Dockerfile-arbitrary-pg.init │ ├── Dockerfile-pgrst.init │ ├── arbitrary_pg_init.py │ └── pgrst_init.py └── pgUI ├── .babelrc.json ├── .gitignore ├── .prettierrc.json ├── .storybook ├── main.ts └── preview.ts ├── LICENSE ├── README.md ├── components ├── Button │ ├── Button.module.scss │ └── index.tsx ├── Card │ ├── Card.module.scss │ └── index.tsx ├── Chip │ ├── Chip.module.scss │ └── index.tsx ├── Header │ ├── Header.module.scss │ └── index.tsx ├── IconButton │ └── index.tsx ├── InstanceCard │ ├── InstanceCard.module.scss │ └── index.tsx ├── InstanceNav │ ├── InstanceNav.module.scss │ ├── index.tsx │ └── instanceNavData.ts ├── Logo │ └── index.tsx ├── Main │ ├── Main.module.scss │ └── index.tsx ├── SearchBar │ ├── SearchBar.module.scss │ └── index.tsx └── Tooltip │ ├── Tooltip.module.scss │ └── index.tsx ├── next.config.js ├── package-lock.json ├── package.json ├── pages ├── _app.tsx ├── api │ └── hello.ts ├── index.tsx └── instances │ └── [id].tsx ├── postcss.config.js ├── public ├── coredb-logo-globe.png ├── coredb-logo.png ├── favicon.ico ├── icons │ ├── activity.svg │ ├── codesandbox.svg │ ├── compass.svg │ ├── database.svg │ ├── iconList.tsx │ ├── server.svg │ ├── sliders.svg │ ├── terminal.svg │ └── users.svg └── vercel.svg ├── stories ├── Button.stories.ts ├── IconButton.stories.ts ├── InstanceNav.stories.ts ├── Introduction.mdx └── assets │ ├── code-brackets.svg │ ├── colors.svg │ ├── comments.svg │ ├── direction.svg │ ├── flow.svg │ ├── plugin.svg │ ├── repo.svg │ └── stackalt.svg ├── styles ├── globals.css └── globals.scss ├── svgrrc.js ├── tailwind.config.js └── tsconfig.json /README.md: -------------------------------------------------------------------------------- 1 | # pgUI 2 | 3 | An experimental user interface for PostgreSQL. 4 | -------------------------------------------------------------------------------- /api/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /api/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "actix-codec" 7 | version = "0.5.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" 10 | dependencies = [ 11 | "bitflags", 12 | "bytes", 13 | "futures-core", 14 | "futures-sink", 15 | "log", 16 | "memchr", 17 | "pin-project-lite", 18 | "tokio", 19 | "tokio-util", 20 | ] 21 | 22 | [[package]] 23 | name = "actix-http" 24 | version = "3.3.0" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "0070905b2c4a98d184c4e81025253cb192aa8a73827553f38e9410801ceb35bb" 27 | dependencies = [ 28 | "actix-codec", 29 | "actix-rt", 30 | "actix-service", 31 | "actix-utils", 32 | "ahash", 33 | "base64 0.21.0", 34 | "bitflags", 35 | "brotli", 36 | "bytes", 37 | "bytestring", 38 | "derive_more", 39 | "encoding_rs", 40 | "flate2", 41 | "futures-core", 42 | "h2", 43 | "http", 44 | "httparse", 45 | "httpdate", 46 | "itoa", 47 | "language-tags", 48 | "local-channel", 49 | "mime", 50 | "percent-encoding", 51 | "pin-project-lite", 52 | "rand", 53 | "sha1", 54 | "smallvec", 55 | "tokio", 56 | "tokio-util", 57 | "tracing", 58 | "zstd", 59 | ] 60 | 61 | [[package]] 62 | name = "actix-macros" 63 | version = "0.2.3" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" 66 | dependencies = [ 67 | "quote", 68 | "syn", 69 | ] 70 | 71 | [[package]] 72 | name = "actix-router" 73 | version = "0.5.1" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" 76 | dependencies = [ 77 | "bytestring", 78 | "http", 79 | "regex", 80 | "serde", 81 | "tracing", 82 | ] 83 | 84 | [[package]] 85 | name = "actix-rt" 86 | version = "2.8.0" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" 89 | dependencies = [ 90 | "futures-core", 91 | "tokio", 92 | ] 93 | 94 | [[package]] 95 | name = "actix-server" 96 | version = "2.2.0" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "3e8613a75dd50cc45f473cee3c34d59ed677c0f7b44480ce3b8247d7dc519327" 99 | dependencies = [ 100 | "actix-rt", 101 | "actix-service", 102 | "actix-utils", 103 | "futures-core", 104 | "futures-util", 105 | "mio", 106 | "num_cpus", 107 | "socket2", 108 | "tokio", 109 | "tracing", 110 | ] 111 | 112 | [[package]] 113 | name = "actix-service" 114 | version = "2.0.2" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" 117 | dependencies = [ 118 | "futures-core", 119 | "paste", 120 | "pin-project-lite", 121 | ] 122 | 123 | [[package]] 124 | name = "actix-utils" 125 | version = "3.0.1" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" 128 | dependencies = [ 129 | "local-waker", 130 | "pin-project-lite", 131 | ] 132 | 133 | [[package]] 134 | name = "actix-web" 135 | version = "4.3.0" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "464e0fddc668ede5f26ec1f9557a8d44eda948732f40c6b0ad79126930eb775f" 138 | dependencies = [ 139 | "actix-codec", 140 | "actix-http", 141 | "actix-macros", 142 | "actix-router", 143 | "actix-rt", 144 | "actix-server", 145 | "actix-service", 146 | "actix-utils", 147 | "actix-web-codegen", 148 | "ahash", 149 | "bytes", 150 | "bytestring", 151 | "cfg-if", 152 | "cookie", 153 | "derive_more", 154 | "encoding_rs", 155 | "futures-core", 156 | "futures-util", 157 | "http", 158 | "itoa", 159 | "language-tags", 160 | "log", 161 | "mime", 162 | "once_cell", 163 | "pin-project-lite", 164 | "regex", 165 | "serde", 166 | "serde_json", 167 | "serde_urlencoded", 168 | "smallvec", 169 | "socket2", 170 | "time", 171 | "url", 172 | ] 173 | 174 | [[package]] 175 | name = "actix-web-codegen" 176 | version = "4.1.0" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "1fa9362663c8643d67b2d5eafba49e4cb2c8a053a29ed00a0bea121f17c76b13" 179 | dependencies = [ 180 | "actix-router", 181 | "proc-macro2", 182 | "quote", 183 | "syn", 184 | ] 185 | 186 | [[package]] 187 | name = "adler" 188 | version = "1.0.2" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 191 | 192 | [[package]] 193 | name = "ahash" 194 | version = "0.7.6" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 197 | dependencies = [ 198 | "getrandom", 199 | "once_cell", 200 | "version_check", 201 | ] 202 | 203 | [[package]] 204 | name = "aho-corasick" 205 | version = "0.7.20" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" 208 | dependencies = [ 209 | "memchr", 210 | ] 211 | 212 | [[package]] 213 | name = "alloc-no-stdlib" 214 | version = "2.0.4" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" 217 | 218 | [[package]] 219 | name = "alloc-stdlib" 220 | version = "0.2.2" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" 223 | dependencies = [ 224 | "alloc-no-stdlib", 225 | ] 226 | 227 | [[package]] 228 | name = "android_system_properties" 229 | version = "0.1.5" 230 | source = "registry+https://github.com/rust-lang/crates.io-index" 231 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 232 | dependencies = [ 233 | "libc", 234 | ] 235 | 236 | [[package]] 237 | name = "atoi" 238 | version = "1.0.0" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" 241 | dependencies = [ 242 | "num-traits", 243 | ] 244 | 245 | [[package]] 246 | name = "autocfg" 247 | version = "1.1.0" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 250 | 251 | [[package]] 252 | name = "base64" 253 | version = "0.13.1" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 256 | 257 | [[package]] 258 | name = "base64" 259 | version = "0.21.0" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" 262 | 263 | [[package]] 264 | name = "bitflags" 265 | version = "1.3.2" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 268 | 269 | [[package]] 270 | name = "block-buffer" 271 | version = "0.10.3" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" 274 | dependencies = [ 275 | "generic-array", 276 | ] 277 | 278 | [[package]] 279 | name = "brotli" 280 | version = "3.3.4" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" 283 | dependencies = [ 284 | "alloc-no-stdlib", 285 | "alloc-stdlib", 286 | "brotli-decompressor", 287 | ] 288 | 289 | [[package]] 290 | name = "brotli-decompressor" 291 | version = "2.3.4" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" 294 | dependencies = [ 295 | "alloc-no-stdlib", 296 | "alloc-stdlib", 297 | ] 298 | 299 | [[package]] 300 | name = "bumpalo" 301 | version = "3.12.0" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" 304 | 305 | [[package]] 306 | name = "byteorder" 307 | version = "1.4.3" 308 | source = "registry+https://github.com/rust-lang/crates.io-index" 309 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 310 | 311 | [[package]] 312 | name = "bytes" 313 | version = "1.4.0" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 316 | 317 | [[package]] 318 | name = "bytestring" 319 | version = "1.2.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "f7f83e57d9154148e355404702e2694463241880b939570d7c97c014da7a69a1" 322 | dependencies = [ 323 | "bytes", 324 | ] 325 | 326 | [[package]] 327 | name = "cc" 328 | version = "1.0.79" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 331 | dependencies = [ 332 | "jobserver", 333 | ] 334 | 335 | [[package]] 336 | name = "cfg-if" 337 | version = "1.0.0" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 340 | 341 | [[package]] 342 | name = "chrono" 343 | version = "0.4.23" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" 346 | dependencies = [ 347 | "iana-time-zone", 348 | "num-integer", 349 | "num-traits", 350 | "winapi", 351 | ] 352 | 353 | [[package]] 354 | name = "codespan-reporting" 355 | version = "0.11.1" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 358 | dependencies = [ 359 | "termcolor", 360 | "unicode-width", 361 | ] 362 | 363 | [[package]] 364 | name = "convert_case" 365 | version = "0.4.0" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" 368 | 369 | [[package]] 370 | name = "cookie" 371 | version = "0.16.2" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" 374 | dependencies = [ 375 | "percent-encoding", 376 | "time", 377 | "version_check", 378 | ] 379 | 380 | [[package]] 381 | name = "core-foundation" 382 | version = "0.9.3" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 385 | dependencies = [ 386 | "core-foundation-sys", 387 | "libc", 388 | ] 389 | 390 | [[package]] 391 | name = "core-foundation-sys" 392 | version = "0.8.3" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 395 | 396 | [[package]] 397 | name = "cpufeatures" 398 | version = "0.2.5" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" 401 | dependencies = [ 402 | "libc", 403 | ] 404 | 405 | [[package]] 406 | name = "crc" 407 | version = "3.0.1" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" 410 | dependencies = [ 411 | "crc-catalog", 412 | ] 413 | 414 | [[package]] 415 | name = "crc-catalog" 416 | version = "2.2.0" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" 419 | 420 | [[package]] 421 | name = "crc32fast" 422 | version = "1.3.2" 423 | source = "registry+https://github.com/rust-lang/crates.io-index" 424 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 425 | dependencies = [ 426 | "cfg-if", 427 | ] 428 | 429 | [[package]] 430 | name = "crossbeam-queue" 431 | version = "0.3.8" 432 | source = "registry+https://github.com/rust-lang/crates.io-index" 433 | checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" 434 | dependencies = [ 435 | "cfg-if", 436 | "crossbeam-utils", 437 | ] 438 | 439 | [[package]] 440 | name = "crossbeam-utils" 441 | version = "0.8.14" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" 444 | dependencies = [ 445 | "cfg-if", 446 | ] 447 | 448 | [[package]] 449 | name = "crypto-common" 450 | version = "0.1.6" 451 | source = "registry+https://github.com/rust-lang/crates.io-index" 452 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 453 | dependencies = [ 454 | "generic-array", 455 | "typenum", 456 | ] 457 | 458 | [[package]] 459 | name = "cxx" 460 | version = "1.0.91" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" 463 | dependencies = [ 464 | "cc", 465 | "cxxbridge-flags", 466 | "cxxbridge-macro", 467 | "link-cplusplus", 468 | ] 469 | 470 | [[package]] 471 | name = "cxx-build" 472 | version = "1.0.91" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" 475 | dependencies = [ 476 | "cc", 477 | "codespan-reporting", 478 | "once_cell", 479 | "proc-macro2", 480 | "quote", 481 | "scratch", 482 | "syn", 483 | ] 484 | 485 | [[package]] 486 | name = "cxxbridge-flags" 487 | version = "1.0.91" 488 | source = "registry+https://github.com/rust-lang/crates.io-index" 489 | checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" 490 | 491 | [[package]] 492 | name = "cxxbridge-macro" 493 | version = "1.0.91" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" 496 | dependencies = [ 497 | "proc-macro2", 498 | "quote", 499 | "syn", 500 | ] 501 | 502 | [[package]] 503 | name = "derive_more" 504 | version = "0.99.17" 505 | source = "registry+https://github.com/rust-lang/crates.io-index" 506 | checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 507 | dependencies = [ 508 | "convert_case", 509 | "proc-macro2", 510 | "quote", 511 | "rustc_version", 512 | "syn", 513 | ] 514 | 515 | [[package]] 516 | name = "digest" 517 | version = "0.10.6" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" 520 | dependencies = [ 521 | "block-buffer", 522 | "crypto-common", 523 | "subtle", 524 | ] 525 | 526 | [[package]] 527 | name = "dirs" 528 | version = "4.0.0" 529 | source = "registry+https://github.com/rust-lang/crates.io-index" 530 | checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" 531 | dependencies = [ 532 | "dirs-sys", 533 | ] 534 | 535 | [[package]] 536 | name = "dirs-sys" 537 | version = "0.3.7" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" 540 | dependencies = [ 541 | "libc", 542 | "redox_users", 543 | "winapi", 544 | ] 545 | 546 | [[package]] 547 | name = "dotenvy" 548 | version = "0.15.6" 549 | source = "registry+https://github.com/rust-lang/crates.io-index" 550 | checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" 551 | 552 | [[package]] 553 | name = "either" 554 | version = "1.8.1" 555 | source = "registry+https://github.com/rust-lang/crates.io-index" 556 | checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" 557 | 558 | [[package]] 559 | name = "encoding_rs" 560 | version = "0.8.32" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 563 | dependencies = [ 564 | "cfg-if", 565 | ] 566 | 567 | [[package]] 568 | name = "event-listener" 569 | version = "2.5.3" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" 572 | 573 | [[package]] 574 | name = "fastrand" 575 | version = "1.9.0" 576 | source = "registry+https://github.com/rust-lang/crates.io-index" 577 | checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" 578 | dependencies = [ 579 | "instant", 580 | ] 581 | 582 | [[package]] 583 | name = "flate2" 584 | version = "1.0.25" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" 587 | dependencies = [ 588 | "crc32fast", 589 | "miniz_oxide", 590 | ] 591 | 592 | [[package]] 593 | name = "fnv" 594 | version = "1.0.7" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 597 | 598 | [[package]] 599 | name = "foreign-types" 600 | version = "0.3.2" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 603 | dependencies = [ 604 | "foreign-types-shared", 605 | ] 606 | 607 | [[package]] 608 | name = "foreign-types-shared" 609 | version = "0.1.1" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 612 | 613 | [[package]] 614 | name = "form_urlencoded" 615 | version = "1.1.0" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 618 | dependencies = [ 619 | "percent-encoding", 620 | ] 621 | 622 | [[package]] 623 | name = "futures-channel" 624 | version = "0.3.26" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" 627 | dependencies = [ 628 | "futures-core", 629 | "futures-sink", 630 | ] 631 | 632 | [[package]] 633 | name = "futures-core" 634 | version = "0.3.26" 635 | source = "registry+https://github.com/rust-lang/crates.io-index" 636 | checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" 637 | 638 | [[package]] 639 | name = "futures-intrusive" 640 | version = "0.4.2" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" 643 | dependencies = [ 644 | "futures-core", 645 | "lock_api", 646 | "parking_lot 0.11.2", 647 | ] 648 | 649 | [[package]] 650 | name = "futures-sink" 651 | version = "0.3.26" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" 654 | 655 | [[package]] 656 | name = "futures-task" 657 | version = "0.3.26" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" 660 | 661 | [[package]] 662 | name = "futures-util" 663 | version = "0.3.26" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" 666 | dependencies = [ 667 | "futures-core", 668 | "futures-sink", 669 | "futures-task", 670 | "pin-project-lite", 671 | "pin-utils", 672 | ] 673 | 674 | [[package]] 675 | name = "generic-array" 676 | version = "0.14.6" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" 679 | dependencies = [ 680 | "typenum", 681 | "version_check", 682 | ] 683 | 684 | [[package]] 685 | name = "getrandom" 686 | version = "0.2.8" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" 689 | dependencies = [ 690 | "cfg-if", 691 | "libc", 692 | "wasi", 693 | ] 694 | 695 | [[package]] 696 | name = "h2" 697 | version = "0.3.15" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" 700 | dependencies = [ 701 | "bytes", 702 | "fnv", 703 | "futures-core", 704 | "futures-sink", 705 | "futures-util", 706 | "http", 707 | "indexmap", 708 | "slab", 709 | "tokio", 710 | "tokio-util", 711 | "tracing", 712 | ] 713 | 714 | [[package]] 715 | name = "hashbrown" 716 | version = "0.12.3" 717 | source = "registry+https://github.com/rust-lang/crates.io-index" 718 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 719 | dependencies = [ 720 | "ahash", 721 | ] 722 | 723 | [[package]] 724 | name = "hashlink" 725 | version = "0.8.1" 726 | source = "registry+https://github.com/rust-lang/crates.io-index" 727 | checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" 728 | dependencies = [ 729 | "hashbrown", 730 | ] 731 | 732 | [[package]] 733 | name = "heck" 734 | version = "0.4.1" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 737 | dependencies = [ 738 | "unicode-segmentation", 739 | ] 740 | 741 | [[package]] 742 | name = "hermit-abi" 743 | version = "0.2.6" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 746 | dependencies = [ 747 | "libc", 748 | ] 749 | 750 | [[package]] 751 | name = "hex" 752 | version = "0.4.3" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 755 | 756 | [[package]] 757 | name = "hkdf" 758 | version = "0.12.3" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" 761 | dependencies = [ 762 | "hmac", 763 | ] 764 | 765 | [[package]] 766 | name = "hmac" 767 | version = "0.12.1" 768 | source = "registry+https://github.com/rust-lang/crates.io-index" 769 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 770 | dependencies = [ 771 | "digest", 772 | ] 773 | 774 | [[package]] 775 | name = "http" 776 | version = "0.2.9" 777 | source = "registry+https://github.com/rust-lang/crates.io-index" 778 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 779 | dependencies = [ 780 | "bytes", 781 | "fnv", 782 | "itoa", 783 | ] 784 | 785 | [[package]] 786 | name = "httparse" 787 | version = "1.8.0" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 790 | 791 | [[package]] 792 | name = "httpdate" 793 | version = "1.0.2" 794 | source = "registry+https://github.com/rust-lang/crates.io-index" 795 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 796 | 797 | [[package]] 798 | name = "iana-time-zone" 799 | version = "0.1.53" 800 | source = "registry+https://github.com/rust-lang/crates.io-index" 801 | checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" 802 | dependencies = [ 803 | "android_system_properties", 804 | "core-foundation-sys", 805 | "iana-time-zone-haiku", 806 | "js-sys", 807 | "wasm-bindgen", 808 | "winapi", 809 | ] 810 | 811 | [[package]] 812 | name = "iana-time-zone-haiku" 813 | version = "0.1.1" 814 | source = "registry+https://github.com/rust-lang/crates.io-index" 815 | checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" 816 | dependencies = [ 817 | "cxx", 818 | "cxx-build", 819 | ] 820 | 821 | [[package]] 822 | name = "idna" 823 | version = "0.3.0" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" 826 | dependencies = [ 827 | "unicode-bidi", 828 | "unicode-normalization", 829 | ] 830 | 831 | [[package]] 832 | name = "indexmap" 833 | version = "1.9.2" 834 | source = "registry+https://github.com/rust-lang/crates.io-index" 835 | checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" 836 | dependencies = [ 837 | "autocfg", 838 | "hashbrown", 839 | ] 840 | 841 | [[package]] 842 | name = "instant" 843 | version = "0.1.12" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 846 | dependencies = [ 847 | "cfg-if", 848 | ] 849 | 850 | [[package]] 851 | name = "itertools" 852 | version = "0.10.5" 853 | source = "registry+https://github.com/rust-lang/crates.io-index" 854 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 855 | dependencies = [ 856 | "either", 857 | ] 858 | 859 | [[package]] 860 | name = "itoa" 861 | version = "1.0.5" 862 | source = "registry+https://github.com/rust-lang/crates.io-index" 863 | checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" 864 | 865 | [[package]] 866 | name = "jobserver" 867 | version = "0.1.25" 868 | source = "registry+https://github.com/rust-lang/crates.io-index" 869 | checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" 870 | dependencies = [ 871 | "libc", 872 | ] 873 | 874 | [[package]] 875 | name = "js-sys" 876 | version = "0.3.61" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" 879 | dependencies = [ 880 | "wasm-bindgen", 881 | ] 882 | 883 | [[package]] 884 | name = "language-tags" 885 | version = "0.3.2" 886 | source = "registry+https://github.com/rust-lang/crates.io-index" 887 | checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" 888 | 889 | [[package]] 890 | name = "lazy_static" 891 | version = "1.4.0" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 894 | 895 | [[package]] 896 | name = "libc" 897 | version = "0.2.139" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" 900 | 901 | [[package]] 902 | name = "link-cplusplus" 903 | version = "1.0.8" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" 906 | dependencies = [ 907 | "cc", 908 | ] 909 | 910 | [[package]] 911 | name = "local-channel" 912 | version = "0.1.3" 913 | source = "registry+https://github.com/rust-lang/crates.io-index" 914 | checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" 915 | dependencies = [ 916 | "futures-core", 917 | "futures-sink", 918 | "futures-util", 919 | "local-waker", 920 | ] 921 | 922 | [[package]] 923 | name = "local-waker" 924 | version = "0.1.3" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" 927 | 928 | [[package]] 929 | name = "lock_api" 930 | version = "0.4.9" 931 | source = "registry+https://github.com/rust-lang/crates.io-index" 932 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 933 | dependencies = [ 934 | "autocfg", 935 | "scopeguard", 936 | ] 937 | 938 | [[package]] 939 | name = "log" 940 | version = "0.4.17" 941 | source = "registry+https://github.com/rust-lang/crates.io-index" 942 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 943 | dependencies = [ 944 | "cfg-if", 945 | ] 946 | 947 | [[package]] 948 | name = "md-5" 949 | version = "0.10.5" 950 | source = "registry+https://github.com/rust-lang/crates.io-index" 951 | checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" 952 | dependencies = [ 953 | "digest", 954 | ] 955 | 956 | [[package]] 957 | name = "memchr" 958 | version = "2.5.0" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 961 | 962 | [[package]] 963 | name = "mime" 964 | version = "0.3.16" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 967 | 968 | [[package]] 969 | name = "minimal-lexical" 970 | version = "0.2.1" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 973 | 974 | [[package]] 975 | name = "miniz_oxide" 976 | version = "0.6.2" 977 | source = "registry+https://github.com/rust-lang/crates.io-index" 978 | checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" 979 | dependencies = [ 980 | "adler", 981 | ] 982 | 983 | [[package]] 984 | name = "mio" 985 | version = "0.8.6" 986 | source = "registry+https://github.com/rust-lang/crates.io-index" 987 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 988 | dependencies = [ 989 | "libc", 990 | "log", 991 | "wasi", 992 | "windows-sys 0.45.0", 993 | ] 994 | 995 | [[package]] 996 | name = "native-tls" 997 | version = "0.2.11" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 1000 | dependencies = [ 1001 | "lazy_static", 1002 | "libc", 1003 | "log", 1004 | "openssl", 1005 | "openssl-probe", 1006 | "openssl-sys", 1007 | "schannel", 1008 | "security-framework", 1009 | "security-framework-sys", 1010 | "tempfile", 1011 | ] 1012 | 1013 | [[package]] 1014 | name = "nom" 1015 | version = "7.1.3" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 1018 | dependencies = [ 1019 | "memchr", 1020 | "minimal-lexical", 1021 | ] 1022 | 1023 | [[package]] 1024 | name = "num-integer" 1025 | version = "0.1.45" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 1028 | dependencies = [ 1029 | "autocfg", 1030 | "num-traits", 1031 | ] 1032 | 1033 | [[package]] 1034 | name = "num-traits" 1035 | version = "0.2.15" 1036 | source = "registry+https://github.com/rust-lang/crates.io-index" 1037 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 1038 | dependencies = [ 1039 | "autocfg", 1040 | ] 1041 | 1042 | [[package]] 1043 | name = "num_cpus" 1044 | version = "1.15.0" 1045 | source = "registry+https://github.com/rust-lang/crates.io-index" 1046 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 1047 | dependencies = [ 1048 | "hermit-abi", 1049 | "libc", 1050 | ] 1051 | 1052 | [[package]] 1053 | name = "once_cell" 1054 | version = "1.17.1" 1055 | source = "registry+https://github.com/rust-lang/crates.io-index" 1056 | checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" 1057 | 1058 | [[package]] 1059 | name = "openssl" 1060 | version = "0.10.45" 1061 | source = "registry+https://github.com/rust-lang/crates.io-index" 1062 | checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" 1063 | dependencies = [ 1064 | "bitflags", 1065 | "cfg-if", 1066 | "foreign-types", 1067 | "libc", 1068 | "once_cell", 1069 | "openssl-macros", 1070 | "openssl-sys", 1071 | ] 1072 | 1073 | [[package]] 1074 | name = "openssl-macros" 1075 | version = "0.1.0" 1076 | source = "registry+https://github.com/rust-lang/crates.io-index" 1077 | checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" 1078 | dependencies = [ 1079 | "proc-macro2", 1080 | "quote", 1081 | "syn", 1082 | ] 1083 | 1084 | [[package]] 1085 | name = "openssl-probe" 1086 | version = "0.1.5" 1087 | source = "registry+https://github.com/rust-lang/crates.io-index" 1088 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 1089 | 1090 | [[package]] 1091 | name = "openssl-sys" 1092 | version = "0.9.80" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" 1095 | dependencies = [ 1096 | "autocfg", 1097 | "cc", 1098 | "libc", 1099 | "pkg-config", 1100 | "vcpkg", 1101 | ] 1102 | 1103 | [[package]] 1104 | name = "parking_lot" 1105 | version = "0.11.2" 1106 | source = "registry+https://github.com/rust-lang/crates.io-index" 1107 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 1108 | dependencies = [ 1109 | "instant", 1110 | "lock_api", 1111 | "parking_lot_core 0.8.6", 1112 | ] 1113 | 1114 | [[package]] 1115 | name = "parking_lot" 1116 | version = "0.12.1" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 1119 | dependencies = [ 1120 | "lock_api", 1121 | "parking_lot_core 0.9.7", 1122 | ] 1123 | 1124 | [[package]] 1125 | name = "parking_lot_core" 1126 | version = "0.8.6" 1127 | source = "registry+https://github.com/rust-lang/crates.io-index" 1128 | checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" 1129 | dependencies = [ 1130 | "cfg-if", 1131 | "instant", 1132 | "libc", 1133 | "redox_syscall", 1134 | "smallvec", 1135 | "winapi", 1136 | ] 1137 | 1138 | [[package]] 1139 | name = "parking_lot_core" 1140 | version = "0.9.7" 1141 | source = "registry+https://github.com/rust-lang/crates.io-index" 1142 | checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" 1143 | dependencies = [ 1144 | "cfg-if", 1145 | "libc", 1146 | "redox_syscall", 1147 | "smallvec", 1148 | "windows-sys 0.45.0", 1149 | ] 1150 | 1151 | [[package]] 1152 | name = "paste" 1153 | version = "1.0.11" 1154 | source = "registry+https://github.com/rust-lang/crates.io-index" 1155 | checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" 1156 | 1157 | [[package]] 1158 | name = "percent-encoding" 1159 | version = "2.2.0" 1160 | source = "registry+https://github.com/rust-lang/crates.io-index" 1161 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 1162 | 1163 | [[package]] 1164 | name = "pgui-api" 1165 | version = "0.1.0" 1166 | dependencies = [ 1167 | "actix-web", 1168 | "base64 0.21.0", 1169 | "log", 1170 | "regex", 1171 | "sqlx", 1172 | "thiserror", 1173 | "url", 1174 | ] 1175 | 1176 | [[package]] 1177 | name = "pin-project-lite" 1178 | version = "0.2.9" 1179 | source = "registry+https://github.com/rust-lang/crates.io-index" 1180 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 1181 | 1182 | [[package]] 1183 | name = "pin-utils" 1184 | version = "0.1.0" 1185 | source = "registry+https://github.com/rust-lang/crates.io-index" 1186 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1187 | 1188 | [[package]] 1189 | name = "pkg-config" 1190 | version = "0.3.26" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" 1193 | 1194 | [[package]] 1195 | name = "ppv-lite86" 1196 | version = "0.2.17" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1199 | 1200 | [[package]] 1201 | name = "proc-macro2" 1202 | version = "1.0.51" 1203 | source = "registry+https://github.com/rust-lang/crates.io-index" 1204 | checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" 1205 | dependencies = [ 1206 | "unicode-ident", 1207 | ] 1208 | 1209 | [[package]] 1210 | name = "quote" 1211 | version = "1.0.23" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" 1214 | dependencies = [ 1215 | "proc-macro2", 1216 | ] 1217 | 1218 | [[package]] 1219 | name = "rand" 1220 | version = "0.8.5" 1221 | source = "registry+https://github.com/rust-lang/crates.io-index" 1222 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1223 | dependencies = [ 1224 | "libc", 1225 | "rand_chacha", 1226 | "rand_core", 1227 | ] 1228 | 1229 | [[package]] 1230 | name = "rand_chacha" 1231 | version = "0.3.1" 1232 | source = "registry+https://github.com/rust-lang/crates.io-index" 1233 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1234 | dependencies = [ 1235 | "ppv-lite86", 1236 | "rand_core", 1237 | ] 1238 | 1239 | [[package]] 1240 | name = "rand_core" 1241 | version = "0.6.4" 1242 | source = "registry+https://github.com/rust-lang/crates.io-index" 1243 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1244 | dependencies = [ 1245 | "getrandom", 1246 | ] 1247 | 1248 | [[package]] 1249 | name = "redox_syscall" 1250 | version = "0.2.16" 1251 | source = "registry+https://github.com/rust-lang/crates.io-index" 1252 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1253 | dependencies = [ 1254 | "bitflags", 1255 | ] 1256 | 1257 | [[package]] 1258 | name = "redox_users" 1259 | version = "0.4.3" 1260 | source = "registry+https://github.com/rust-lang/crates.io-index" 1261 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1262 | dependencies = [ 1263 | "getrandom", 1264 | "redox_syscall", 1265 | "thiserror", 1266 | ] 1267 | 1268 | [[package]] 1269 | name = "regex" 1270 | version = "1.7.1" 1271 | source = "registry+https://github.com/rust-lang/crates.io-index" 1272 | checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" 1273 | dependencies = [ 1274 | "aho-corasick", 1275 | "memchr", 1276 | "regex-syntax", 1277 | ] 1278 | 1279 | [[package]] 1280 | name = "regex-syntax" 1281 | version = "0.6.28" 1282 | source = "registry+https://github.com/rust-lang/crates.io-index" 1283 | checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" 1284 | 1285 | [[package]] 1286 | name = "remove_dir_all" 1287 | version = "0.5.3" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 1290 | dependencies = [ 1291 | "winapi", 1292 | ] 1293 | 1294 | [[package]] 1295 | name = "rustc_version" 1296 | version = "0.4.0" 1297 | source = "registry+https://github.com/rust-lang/crates.io-index" 1298 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 1299 | dependencies = [ 1300 | "semver", 1301 | ] 1302 | 1303 | [[package]] 1304 | name = "ryu" 1305 | version = "1.0.12" 1306 | source = "registry+https://github.com/rust-lang/crates.io-index" 1307 | checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" 1308 | 1309 | [[package]] 1310 | name = "schannel" 1311 | version = "0.1.21" 1312 | source = "registry+https://github.com/rust-lang/crates.io-index" 1313 | checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" 1314 | dependencies = [ 1315 | "windows-sys 0.42.0", 1316 | ] 1317 | 1318 | [[package]] 1319 | name = "scopeguard" 1320 | version = "1.1.0" 1321 | source = "registry+https://github.com/rust-lang/crates.io-index" 1322 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1323 | 1324 | [[package]] 1325 | name = "scratch" 1326 | version = "1.0.3" 1327 | source = "registry+https://github.com/rust-lang/crates.io-index" 1328 | checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" 1329 | 1330 | [[package]] 1331 | name = "security-framework" 1332 | version = "2.8.2" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" 1335 | dependencies = [ 1336 | "bitflags", 1337 | "core-foundation", 1338 | "core-foundation-sys", 1339 | "libc", 1340 | "security-framework-sys", 1341 | ] 1342 | 1343 | [[package]] 1344 | name = "security-framework-sys" 1345 | version = "2.8.0" 1346 | source = "registry+https://github.com/rust-lang/crates.io-index" 1347 | checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" 1348 | dependencies = [ 1349 | "core-foundation-sys", 1350 | "libc", 1351 | ] 1352 | 1353 | [[package]] 1354 | name = "semver" 1355 | version = "1.0.16" 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" 1357 | checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" 1358 | 1359 | [[package]] 1360 | name = "serde" 1361 | version = "1.0.152" 1362 | source = "registry+https://github.com/rust-lang/crates.io-index" 1363 | checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" 1364 | dependencies = [ 1365 | "serde_derive", 1366 | ] 1367 | 1368 | [[package]] 1369 | name = "serde_derive" 1370 | version = "1.0.152" 1371 | source = "registry+https://github.com/rust-lang/crates.io-index" 1372 | checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" 1373 | dependencies = [ 1374 | "proc-macro2", 1375 | "quote", 1376 | "syn", 1377 | ] 1378 | 1379 | [[package]] 1380 | name = "serde_json" 1381 | version = "1.0.93" 1382 | source = "registry+https://github.com/rust-lang/crates.io-index" 1383 | checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" 1384 | dependencies = [ 1385 | "itoa", 1386 | "ryu", 1387 | "serde", 1388 | ] 1389 | 1390 | [[package]] 1391 | name = "serde_urlencoded" 1392 | version = "0.7.1" 1393 | source = "registry+https://github.com/rust-lang/crates.io-index" 1394 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1395 | dependencies = [ 1396 | "form_urlencoded", 1397 | "itoa", 1398 | "ryu", 1399 | "serde", 1400 | ] 1401 | 1402 | [[package]] 1403 | name = "sha1" 1404 | version = "0.10.5" 1405 | source = "registry+https://github.com/rust-lang/crates.io-index" 1406 | checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" 1407 | dependencies = [ 1408 | "cfg-if", 1409 | "cpufeatures", 1410 | "digest", 1411 | ] 1412 | 1413 | [[package]] 1414 | name = "sha2" 1415 | version = "0.10.6" 1416 | source = "registry+https://github.com/rust-lang/crates.io-index" 1417 | checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" 1418 | dependencies = [ 1419 | "cfg-if", 1420 | "cpufeatures", 1421 | "digest", 1422 | ] 1423 | 1424 | [[package]] 1425 | name = "signal-hook-registry" 1426 | version = "1.4.1" 1427 | source = "registry+https://github.com/rust-lang/crates.io-index" 1428 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 1429 | dependencies = [ 1430 | "libc", 1431 | ] 1432 | 1433 | [[package]] 1434 | name = "slab" 1435 | version = "0.4.8" 1436 | source = "registry+https://github.com/rust-lang/crates.io-index" 1437 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 1438 | dependencies = [ 1439 | "autocfg", 1440 | ] 1441 | 1442 | [[package]] 1443 | name = "smallvec" 1444 | version = "1.10.0" 1445 | source = "registry+https://github.com/rust-lang/crates.io-index" 1446 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 1447 | 1448 | [[package]] 1449 | name = "socket2" 1450 | version = "0.4.7" 1451 | source = "registry+https://github.com/rust-lang/crates.io-index" 1452 | checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" 1453 | dependencies = [ 1454 | "libc", 1455 | "winapi", 1456 | ] 1457 | 1458 | [[package]] 1459 | name = "sqlformat" 1460 | version = "0.2.1" 1461 | source = "registry+https://github.com/rust-lang/crates.io-index" 1462 | checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" 1463 | dependencies = [ 1464 | "itertools", 1465 | "nom", 1466 | "unicode_categories", 1467 | ] 1468 | 1469 | [[package]] 1470 | name = "sqlx" 1471 | version = "0.6.2" 1472 | source = "registry+https://github.com/rust-lang/crates.io-index" 1473 | checksum = "9249290c05928352f71c077cc44a464d880c63f26f7534728cca008e135c0428" 1474 | dependencies = [ 1475 | "sqlx-core", 1476 | "sqlx-macros", 1477 | ] 1478 | 1479 | [[package]] 1480 | name = "sqlx-core" 1481 | version = "0.6.2" 1482 | source = "registry+https://github.com/rust-lang/crates.io-index" 1483 | checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105" 1484 | dependencies = [ 1485 | "ahash", 1486 | "atoi", 1487 | "base64 0.13.1", 1488 | "bitflags", 1489 | "byteorder", 1490 | "bytes", 1491 | "chrono", 1492 | "crc", 1493 | "crossbeam-queue", 1494 | "dirs", 1495 | "dotenvy", 1496 | "either", 1497 | "event-listener", 1498 | "futures-channel", 1499 | "futures-core", 1500 | "futures-intrusive", 1501 | "futures-util", 1502 | "hashlink", 1503 | "hex", 1504 | "hkdf", 1505 | "hmac", 1506 | "indexmap", 1507 | "itoa", 1508 | "libc", 1509 | "log", 1510 | "md-5", 1511 | "memchr", 1512 | "once_cell", 1513 | "paste", 1514 | "percent-encoding", 1515 | "rand", 1516 | "serde", 1517 | "serde_json", 1518 | "sha1", 1519 | "sha2", 1520 | "smallvec", 1521 | "sqlformat", 1522 | "sqlx-rt", 1523 | "stringprep", 1524 | "thiserror", 1525 | "tokio-stream", 1526 | "url", 1527 | "whoami", 1528 | ] 1529 | 1530 | [[package]] 1531 | name = "sqlx-macros" 1532 | version = "0.6.2" 1533 | source = "registry+https://github.com/rust-lang/crates.io-index" 1534 | checksum = "b850fa514dc11f2ee85be9d055c512aa866746adfacd1cb42d867d68e6a5b0d9" 1535 | dependencies = [ 1536 | "dotenvy", 1537 | "either", 1538 | "heck", 1539 | "once_cell", 1540 | "proc-macro2", 1541 | "quote", 1542 | "sha2", 1543 | "sqlx-core", 1544 | "sqlx-rt", 1545 | "syn", 1546 | "url", 1547 | ] 1548 | 1549 | [[package]] 1550 | name = "sqlx-rt" 1551 | version = "0.6.2" 1552 | source = "registry+https://github.com/rust-lang/crates.io-index" 1553 | checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396" 1554 | dependencies = [ 1555 | "native-tls", 1556 | "once_cell", 1557 | "tokio", 1558 | "tokio-native-tls", 1559 | ] 1560 | 1561 | [[package]] 1562 | name = "stringprep" 1563 | version = "0.1.2" 1564 | source = "registry+https://github.com/rust-lang/crates.io-index" 1565 | checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" 1566 | dependencies = [ 1567 | "unicode-bidi", 1568 | "unicode-normalization", 1569 | ] 1570 | 1571 | [[package]] 1572 | name = "subtle" 1573 | version = "2.4.1" 1574 | source = "registry+https://github.com/rust-lang/crates.io-index" 1575 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 1576 | 1577 | [[package]] 1578 | name = "syn" 1579 | version = "1.0.107" 1580 | source = "registry+https://github.com/rust-lang/crates.io-index" 1581 | checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" 1582 | dependencies = [ 1583 | "proc-macro2", 1584 | "quote", 1585 | "unicode-ident", 1586 | ] 1587 | 1588 | [[package]] 1589 | name = "tempfile" 1590 | version = "3.3.0" 1591 | source = "registry+https://github.com/rust-lang/crates.io-index" 1592 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 1593 | dependencies = [ 1594 | "cfg-if", 1595 | "fastrand", 1596 | "libc", 1597 | "redox_syscall", 1598 | "remove_dir_all", 1599 | "winapi", 1600 | ] 1601 | 1602 | [[package]] 1603 | name = "termcolor" 1604 | version = "1.2.0" 1605 | source = "registry+https://github.com/rust-lang/crates.io-index" 1606 | checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" 1607 | dependencies = [ 1608 | "winapi-util", 1609 | ] 1610 | 1611 | [[package]] 1612 | name = "thiserror" 1613 | version = "1.0.38" 1614 | source = "registry+https://github.com/rust-lang/crates.io-index" 1615 | checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" 1616 | dependencies = [ 1617 | "thiserror-impl", 1618 | ] 1619 | 1620 | [[package]] 1621 | name = "thiserror-impl" 1622 | version = "1.0.38" 1623 | source = "registry+https://github.com/rust-lang/crates.io-index" 1624 | checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" 1625 | dependencies = [ 1626 | "proc-macro2", 1627 | "quote", 1628 | "syn", 1629 | ] 1630 | 1631 | [[package]] 1632 | name = "time" 1633 | version = "0.3.19" 1634 | source = "registry+https://github.com/rust-lang/crates.io-index" 1635 | checksum = "53250a3b3fed8ff8fd988587d8925d26a83ac3845d9e03b220b37f34c2b8d6c2" 1636 | dependencies = [ 1637 | "itoa", 1638 | "serde", 1639 | "time-core", 1640 | "time-macros", 1641 | ] 1642 | 1643 | [[package]] 1644 | name = "time-core" 1645 | version = "0.1.0" 1646 | source = "registry+https://github.com/rust-lang/crates.io-index" 1647 | checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" 1648 | 1649 | [[package]] 1650 | name = "time-macros" 1651 | version = "0.2.7" 1652 | source = "registry+https://github.com/rust-lang/crates.io-index" 1653 | checksum = "a460aeb8de6dcb0f381e1ee05f1cd56fcf5a5f6eb8187ff3d8f0b11078d38b7c" 1654 | dependencies = [ 1655 | "time-core", 1656 | ] 1657 | 1658 | [[package]] 1659 | name = "tinyvec" 1660 | version = "1.6.0" 1661 | source = "registry+https://github.com/rust-lang/crates.io-index" 1662 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1663 | dependencies = [ 1664 | "tinyvec_macros", 1665 | ] 1666 | 1667 | [[package]] 1668 | name = "tinyvec_macros" 1669 | version = "0.1.1" 1670 | source = "registry+https://github.com/rust-lang/crates.io-index" 1671 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1672 | 1673 | [[package]] 1674 | name = "tokio" 1675 | version = "1.25.0" 1676 | source = "registry+https://github.com/rust-lang/crates.io-index" 1677 | checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" 1678 | dependencies = [ 1679 | "autocfg", 1680 | "bytes", 1681 | "libc", 1682 | "memchr", 1683 | "mio", 1684 | "num_cpus", 1685 | "parking_lot 0.12.1", 1686 | "pin-project-lite", 1687 | "signal-hook-registry", 1688 | "socket2", 1689 | "windows-sys 0.42.0", 1690 | ] 1691 | 1692 | [[package]] 1693 | name = "tokio-native-tls" 1694 | version = "0.3.1" 1695 | source = "registry+https://github.com/rust-lang/crates.io-index" 1696 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1697 | dependencies = [ 1698 | "native-tls", 1699 | "tokio", 1700 | ] 1701 | 1702 | [[package]] 1703 | name = "tokio-stream" 1704 | version = "0.1.12" 1705 | source = "registry+https://github.com/rust-lang/crates.io-index" 1706 | checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" 1707 | dependencies = [ 1708 | "futures-core", 1709 | "pin-project-lite", 1710 | "tokio", 1711 | ] 1712 | 1713 | [[package]] 1714 | name = "tokio-util" 1715 | version = "0.7.7" 1716 | source = "registry+https://github.com/rust-lang/crates.io-index" 1717 | checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" 1718 | dependencies = [ 1719 | "bytes", 1720 | "futures-core", 1721 | "futures-sink", 1722 | "pin-project-lite", 1723 | "tokio", 1724 | "tracing", 1725 | ] 1726 | 1727 | [[package]] 1728 | name = "tracing" 1729 | version = "0.1.37" 1730 | source = "registry+https://github.com/rust-lang/crates.io-index" 1731 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1732 | dependencies = [ 1733 | "cfg-if", 1734 | "log", 1735 | "pin-project-lite", 1736 | "tracing-core", 1737 | ] 1738 | 1739 | [[package]] 1740 | name = "tracing-core" 1741 | version = "0.1.30" 1742 | source = "registry+https://github.com/rust-lang/crates.io-index" 1743 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 1744 | dependencies = [ 1745 | "once_cell", 1746 | ] 1747 | 1748 | [[package]] 1749 | name = "typenum" 1750 | version = "1.16.0" 1751 | source = "registry+https://github.com/rust-lang/crates.io-index" 1752 | checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" 1753 | 1754 | [[package]] 1755 | name = "unicode-bidi" 1756 | version = "0.3.10" 1757 | source = "registry+https://github.com/rust-lang/crates.io-index" 1758 | checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" 1759 | 1760 | [[package]] 1761 | name = "unicode-ident" 1762 | version = "1.0.6" 1763 | source = "registry+https://github.com/rust-lang/crates.io-index" 1764 | checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" 1765 | 1766 | [[package]] 1767 | name = "unicode-normalization" 1768 | version = "0.1.22" 1769 | source = "registry+https://github.com/rust-lang/crates.io-index" 1770 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1771 | dependencies = [ 1772 | "tinyvec", 1773 | ] 1774 | 1775 | [[package]] 1776 | name = "unicode-segmentation" 1777 | version = "1.10.1" 1778 | source = "registry+https://github.com/rust-lang/crates.io-index" 1779 | checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" 1780 | 1781 | [[package]] 1782 | name = "unicode-width" 1783 | version = "0.1.10" 1784 | source = "registry+https://github.com/rust-lang/crates.io-index" 1785 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 1786 | 1787 | [[package]] 1788 | name = "unicode_categories" 1789 | version = "0.1.1" 1790 | source = "registry+https://github.com/rust-lang/crates.io-index" 1791 | checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" 1792 | 1793 | [[package]] 1794 | name = "url" 1795 | version = "2.3.1" 1796 | source = "registry+https://github.com/rust-lang/crates.io-index" 1797 | checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" 1798 | dependencies = [ 1799 | "form_urlencoded", 1800 | "idna", 1801 | "percent-encoding", 1802 | ] 1803 | 1804 | [[package]] 1805 | name = "vcpkg" 1806 | version = "0.2.15" 1807 | source = "registry+https://github.com/rust-lang/crates.io-index" 1808 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1809 | 1810 | [[package]] 1811 | name = "version_check" 1812 | version = "0.9.4" 1813 | source = "registry+https://github.com/rust-lang/crates.io-index" 1814 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1815 | 1816 | [[package]] 1817 | name = "wasi" 1818 | version = "0.11.0+wasi-snapshot-preview1" 1819 | source = "registry+https://github.com/rust-lang/crates.io-index" 1820 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1821 | 1822 | [[package]] 1823 | name = "wasm-bindgen" 1824 | version = "0.2.84" 1825 | source = "registry+https://github.com/rust-lang/crates.io-index" 1826 | checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" 1827 | dependencies = [ 1828 | "cfg-if", 1829 | "wasm-bindgen-macro", 1830 | ] 1831 | 1832 | [[package]] 1833 | name = "wasm-bindgen-backend" 1834 | version = "0.2.84" 1835 | source = "registry+https://github.com/rust-lang/crates.io-index" 1836 | checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" 1837 | dependencies = [ 1838 | "bumpalo", 1839 | "log", 1840 | "once_cell", 1841 | "proc-macro2", 1842 | "quote", 1843 | "syn", 1844 | "wasm-bindgen-shared", 1845 | ] 1846 | 1847 | [[package]] 1848 | name = "wasm-bindgen-macro" 1849 | version = "0.2.84" 1850 | source = "registry+https://github.com/rust-lang/crates.io-index" 1851 | checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" 1852 | dependencies = [ 1853 | "quote", 1854 | "wasm-bindgen-macro-support", 1855 | ] 1856 | 1857 | [[package]] 1858 | name = "wasm-bindgen-macro-support" 1859 | version = "0.2.84" 1860 | source = "registry+https://github.com/rust-lang/crates.io-index" 1861 | checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" 1862 | dependencies = [ 1863 | "proc-macro2", 1864 | "quote", 1865 | "syn", 1866 | "wasm-bindgen-backend", 1867 | "wasm-bindgen-shared", 1868 | ] 1869 | 1870 | [[package]] 1871 | name = "wasm-bindgen-shared" 1872 | version = "0.2.84" 1873 | source = "registry+https://github.com/rust-lang/crates.io-index" 1874 | checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" 1875 | 1876 | [[package]] 1877 | name = "web-sys" 1878 | version = "0.3.61" 1879 | source = "registry+https://github.com/rust-lang/crates.io-index" 1880 | checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" 1881 | dependencies = [ 1882 | "js-sys", 1883 | "wasm-bindgen", 1884 | ] 1885 | 1886 | [[package]] 1887 | name = "whoami" 1888 | version = "1.3.0" 1889 | source = "registry+https://github.com/rust-lang/crates.io-index" 1890 | checksum = "45dbc71f0cdca27dc261a9bd37ddec174e4a0af2b900b890f378460f745426e3" 1891 | dependencies = [ 1892 | "wasm-bindgen", 1893 | "web-sys", 1894 | ] 1895 | 1896 | [[package]] 1897 | name = "winapi" 1898 | version = "0.3.9" 1899 | source = "registry+https://github.com/rust-lang/crates.io-index" 1900 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1901 | dependencies = [ 1902 | "winapi-i686-pc-windows-gnu", 1903 | "winapi-x86_64-pc-windows-gnu", 1904 | ] 1905 | 1906 | [[package]] 1907 | name = "winapi-i686-pc-windows-gnu" 1908 | version = "0.4.0" 1909 | source = "registry+https://github.com/rust-lang/crates.io-index" 1910 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1911 | 1912 | [[package]] 1913 | name = "winapi-util" 1914 | version = "0.1.5" 1915 | source = "registry+https://github.com/rust-lang/crates.io-index" 1916 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1917 | dependencies = [ 1918 | "winapi", 1919 | ] 1920 | 1921 | [[package]] 1922 | name = "winapi-x86_64-pc-windows-gnu" 1923 | version = "0.4.0" 1924 | source = "registry+https://github.com/rust-lang/crates.io-index" 1925 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1926 | 1927 | [[package]] 1928 | name = "windows-sys" 1929 | version = "0.42.0" 1930 | source = "registry+https://github.com/rust-lang/crates.io-index" 1931 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 1932 | dependencies = [ 1933 | "windows_aarch64_gnullvm", 1934 | "windows_aarch64_msvc", 1935 | "windows_i686_gnu", 1936 | "windows_i686_msvc", 1937 | "windows_x86_64_gnu", 1938 | "windows_x86_64_gnullvm", 1939 | "windows_x86_64_msvc", 1940 | ] 1941 | 1942 | [[package]] 1943 | name = "windows-sys" 1944 | version = "0.45.0" 1945 | source = "registry+https://github.com/rust-lang/crates.io-index" 1946 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 1947 | dependencies = [ 1948 | "windows-targets", 1949 | ] 1950 | 1951 | [[package]] 1952 | name = "windows-targets" 1953 | version = "0.42.1" 1954 | source = "registry+https://github.com/rust-lang/crates.io-index" 1955 | checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" 1956 | dependencies = [ 1957 | "windows_aarch64_gnullvm", 1958 | "windows_aarch64_msvc", 1959 | "windows_i686_gnu", 1960 | "windows_i686_msvc", 1961 | "windows_x86_64_gnu", 1962 | "windows_x86_64_gnullvm", 1963 | "windows_x86_64_msvc", 1964 | ] 1965 | 1966 | [[package]] 1967 | name = "windows_aarch64_gnullvm" 1968 | version = "0.42.1" 1969 | source = "registry+https://github.com/rust-lang/crates.io-index" 1970 | checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" 1971 | 1972 | [[package]] 1973 | name = "windows_aarch64_msvc" 1974 | version = "0.42.1" 1975 | source = "registry+https://github.com/rust-lang/crates.io-index" 1976 | checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" 1977 | 1978 | [[package]] 1979 | name = "windows_i686_gnu" 1980 | version = "0.42.1" 1981 | source = "registry+https://github.com/rust-lang/crates.io-index" 1982 | checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" 1983 | 1984 | [[package]] 1985 | name = "windows_i686_msvc" 1986 | version = "0.42.1" 1987 | source = "registry+https://github.com/rust-lang/crates.io-index" 1988 | checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" 1989 | 1990 | [[package]] 1991 | name = "windows_x86_64_gnu" 1992 | version = "0.42.1" 1993 | source = "registry+https://github.com/rust-lang/crates.io-index" 1994 | checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" 1995 | 1996 | [[package]] 1997 | name = "windows_x86_64_gnullvm" 1998 | version = "0.42.1" 1999 | source = "registry+https://github.com/rust-lang/crates.io-index" 2000 | checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" 2001 | 2002 | [[package]] 2003 | name = "windows_x86_64_msvc" 2004 | version = "0.42.1" 2005 | source = "registry+https://github.com/rust-lang/crates.io-index" 2006 | checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" 2007 | 2008 | [[package]] 2009 | name = "zstd" 2010 | version = "0.12.3+zstd.1.5.2" 2011 | source = "registry+https://github.com/rust-lang/crates.io-index" 2012 | checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" 2013 | dependencies = [ 2014 | "zstd-safe", 2015 | ] 2016 | 2017 | [[package]] 2018 | name = "zstd-safe" 2019 | version = "6.0.4+zstd.1.5.4" 2020 | source = "registry+https://github.com/rust-lang/crates.io-index" 2021 | checksum = "7afb4b54b8910cf5447638cb54bf4e8a65cbedd783af98b98c62ffe91f185543" 2022 | dependencies = [ 2023 | "libc", 2024 | "zstd-sys", 2025 | ] 2026 | 2027 | [[package]] 2028 | name = "zstd-sys" 2029 | version = "2.0.7+zstd.1.5.4" 2030 | source = "registry+https://github.com/rust-lang/crates.io-index" 2031 | checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" 2032 | dependencies = [ 2033 | "cc", 2034 | "libc", 2035 | "pkg-config", 2036 | ] 2037 | -------------------------------------------------------------------------------- /api/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pgui-api" 3 | version = "0.1.1" 4 | edition = "2021" 5 | authors = ["CoreDB.io"] 6 | description = "A backend API for pgUI." 7 | homepage = "https://www.coredb.io" 8 | keywords = ["api", "postgres"] 9 | license = "Apache-2.0" 10 | repository = "https://github.com/CoreDB-io/coredb/tree/main/pgUI/api" 11 | 12 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 13 | 14 | [dependencies] 15 | actix-web = "4.3.0" 16 | regex = "1.7.1" 17 | url = "2.3.1" 18 | sqlx = { version = "0.6", features = [ "runtime-tokio-native-tls" , "postgres", "chrono" ] } 19 | log = "0.4.17" 20 | thiserror = "1.0.38" 21 | base64 = "0.21.0" 22 | -------------------------------------------------------------------------------- /api/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/coredb/rust:1.66.1 as builder 2 | COPY Cargo.toml Cargo.lock ./ 3 | COPY src ./src 4 | RUN cargo build --release && \ 5 | cargo clean -p pgui-api 6 | RUN cargo install --path . 7 | 8 | FROM quay.io/coredb/rust:1.66.1-slim-buster 9 | COPY --from=builder /usr/local/cargo/bin/* /usr/local/bin/ 10 | ENV RUST_LOG=info 11 | -------------------------------------------------------------------------------- /api/src/config.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | 3 | #[derive(Debug)] 4 | pub struct Config { 5 | pub pg_conn_str: String, 6 | } 7 | 8 | impl Default for Config { 9 | fn default() -> Self { 10 | Self { 11 | pg_conn_str: from_env_default( 12 | "POSTGRES_CONNECTION", 13 | "postgresql://postgres:postgres@0.0.0.0:5432/postgres", 14 | ), 15 | } 16 | } 17 | } 18 | 19 | /// source a variable from environment - use default if not exists 20 | fn from_env_default(key: &str, default: &str) -> String { 21 | env::var(key).unwrap_or_else(|_| default.to_owned()) 22 | } 23 | -------------------------------------------------------------------------------- /api/src/errors.rs: -------------------------------------------------------------------------------- 1 | //! Custom errors types for pgui-api 2 | use thiserror::Error; 3 | use url::ParseError; 4 | 5 | #[derive(Error, Debug)] 6 | pub enum PgUIAPIError { 7 | /// a url parsing error 8 | #[error("url parsing error {0}")] 9 | UrlParsingError(#[from] ParseError), 10 | 11 | /// a database error 12 | #[error("database error {0}")] 13 | DatabaseError(#[from] sqlx::Error), 14 | } 15 | -------------------------------------------------------------------------------- /api/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod config; 2 | mod errors; 3 | pub mod routes; 4 | 5 | use log::LevelFilter; 6 | use sqlx::postgres::{PgConnectOptions, PgPoolOptions}; 7 | use sqlx::{ConnectOptions, Pool, Postgres}; 8 | use url::{ParseError, Url}; 9 | 10 | // Connect to postgresql server 11 | pub async fn connect(url: &str) -> Result, errors::PgUIAPIError> { 12 | let options = conn_options(url)?; 13 | let pgp = PgPoolOptions::new() 14 | .acquire_timeout(std::time::Duration::from_secs(10)) 15 | .max_connections(5) 16 | .connect_with(options) 17 | .await?; 18 | Ok(pgp) 19 | } 20 | 21 | // Configure connection options 22 | pub fn conn_options(url: &str) -> Result { 23 | // Parse url 24 | let parsed = Url::parse(url)?; 25 | let mut options = PgConnectOptions::new() 26 | .host(parsed.host_str().ok_or(ParseError::EmptyHost)?) 27 | .port(parsed.port().ok_or(ParseError::InvalidPort)?) 28 | .username(parsed.username()) 29 | .password(parsed.password().ok_or(ParseError::IdnaError)?); 30 | options.log_statements(LevelFilter::Debug); 31 | Ok(options) 32 | } 33 | -------------------------------------------------------------------------------- /api/src/main.rs: -------------------------------------------------------------------------------- 1 | use actix_web::{web, App, HttpServer}; 2 | use pgui_api::routes::get_queries; 3 | use pgui_api::{config, connect, routes}; 4 | 5 | // pgUI will make requests to this webserver in order to retrieve data it needs to present (SQL query 6 | // data, time series data, etc) 7 | 8 | #[actix_web::main] 9 | async fn main() -> std::io::Result<()> { 10 | // load configurations from environment 11 | let cfg = config::Config::default(); 12 | // Initialize connection to backend postgresql server 13 | let conn = connect(&cfg.pg_conn_str).await.unwrap(); 14 | 15 | HttpServer::new(move || { 16 | App::new() 17 | .app_data(web::Data::new(conn.clone())) 18 | .service(routes::running) 19 | .service(routes::connection) 20 | .service(get_queries) 21 | }) 22 | .bind(("0.0.0.0", 8080))? 23 | .run() 24 | .await 25 | } 26 | -------------------------------------------------------------------------------- /api/src/routes.rs: -------------------------------------------------------------------------------- 1 | use crate::connect; 2 | use actix_web::{get, post, web, HttpResponse, Responder}; 3 | use base64::{engine::general_purpose, Engine as _}; 4 | use regex::Regex; 5 | use sqlx::postgres::PgRow; 6 | use sqlx::{Error, Pool, Postgres, Row}; 7 | 8 | #[get("/")] 9 | pub async fn running() -> impl Responder { 10 | HttpResponse::Ok().body("API is up and running!") 11 | } 12 | 13 | #[post("/connection")] 14 | pub async fn connection(conn_str: String, conn: web::Data>) -> impl Responder { 15 | // Validate connection string format 16 | // TODO(ianstanton) regex needs to be tweaked a bit (password) 17 | let re = Regex::new(r"(postgres|postgresql)://[a-zA-Z][0-9a-zA-Z_-]*:[a-zA-Z][0-9a-zA-Z_-]*@[a-zA-Z][0-9a-zA-Z_-]*:[0-9]*/[a-zA-Z][0-9a-zA-Z_-]*$").unwrap(); 18 | if !re.is_match(&conn_str) { 19 | println!("Connection string is improperly formatted"); 20 | HttpResponse::BadRequest().body("") 21 | } else { 22 | // Connect to postgres 23 | let mut tx = conn.begin().await.unwrap(); 24 | // Ensure connection string table exists 25 | sqlx::query("CREATE TABLE IF NOT EXISTS conn_str (id int, conn text);") 26 | .execute(&mut tx) 27 | .await 28 | .unwrap(); 29 | // base64 encode connection string 30 | // TODO(ianstanton) Properly encrypt connection string 31 | let conn_b64 = general_purpose::STANDARD.encode(conn_str); 32 | // Create identifier for conn string 33 | // Write connection info to table 34 | // TODO(ianstanton) Accept user provided ID and use in INSERT 35 | sqlx::query(format!("INSERT INTO conn_str VALUES (1, '{}');", conn_b64).as_str()) 36 | .execute(&mut tx) 37 | .await 38 | .unwrap(); 39 | tx.commit().await.unwrap(); 40 | HttpResponse::Ok().body("Connection string saved") 41 | } 42 | } 43 | 44 | #[get("/get-queries")] 45 | pub async fn get_queries(conn: web::Data>) -> impl Responder { 46 | let mut queries: Vec<(f64, f64, String)> = Vec::new(); 47 | // Connect to backend postgresql server and query for connection string 48 | let mut tx = conn.begin().await.unwrap(); 49 | // TODO(ianstanton) Query conn_str for a connection string with a given ID 50 | let row: Result = sqlx::query("SELECT * FROM conn_str;") 51 | .fetch_one(&mut tx) 52 | .await; 53 | tx.commit().await.unwrap(); 54 | // Connect to postgres instance 55 | let conn_str_b64: String = row.unwrap().get(1); 56 | // Decode connection string 57 | let conn_str = b64_decode(&conn_str_b64); 58 | let new_conn = connect(&conn_str).await.unwrap(); 59 | tx = new_conn.begin().await.unwrap(); 60 | let query = "SELECT (total_exec_time / 1000 / 60) as total, (total_exec_time/calls) as avg, query FROM pg_stat_statements ORDER BY 1 DESC LIMIT 10;"; 61 | let rows: Result, Error> = sqlx::query(query).fetch_all(&mut tx).await; 62 | for row in rows.unwrap().iter() { 63 | queries.push((row.get(0), row.get(1), row.get(2))); 64 | } 65 | // Return results in response 66 | HttpResponse::Ok().body(format!("Queries... {:?}", queries)) 67 | } 68 | 69 | fn b64_decode(b64_encoded: &str) -> String { 70 | let bytes = general_purpose::STANDARD.decode(b64_encoded).unwrap(); 71 | std::str::from_utf8(&bytes).unwrap().to_owned() 72 | } 73 | -------------------------------------------------------------------------------- /pgDagger/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2023 CoreDB, Inc. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /pgDagger/README.md: -------------------------------------------------------------------------------- 1 | # WIP: pgdagger 2 | 3 | A metrics collector-aggregator for Postgres 4 | 5 | ## Usage 6 | 7 | Start the stack: 8 | 9 | ```bash 10 | docker compose up 11 | ``` 12 | 13 | ## Query via REST 14 | 15 | Postgres data types are documented [here](https://postgrest.org/en/stable/how-tos/working-with-postgresql-data-types.html#timestamps) 16 | 17 | ```bash 18 | curl http://localhost:3001/prom_pg_stat_database_sessions_killed?time=gte.2023-02-14+21:40:15 19 | ``` 20 | 21 | ```json 22 | [ 23 | {"time":"2023-02-14T21:40:55.18+00:00","value":15,"labels":{"job": "metrics_exporter", "group": "postgres", "server": "arbitrary_postgres:5433", "monitor": "pgDagger-prometheus", "__name__": "pg_stat_bgwriter_checkpoints_timed_total", "instance": "metrics_exporter:9187"}}, 24 | {"time":"2023-02-14T21:41:05.18+00:00","value":15,"labels":{"job": "metrics_exporter", "group": "postgres", "server": "arbitrary_postgres:5433", "monitor": "pgDagger-prometheus", "__name__": "pg_stat_bgwriter_checkpoints_timed_total", "instance": "metrics_exporter:9187"}}, 25 | {"time":"2023-02-14T21:41:15.18+00:00","value":15,"labels":{"job": "metrics_exporter", "group": "postgres", "server": "arbitrary_postgres:5433", "monitor": "pgDagger-prometheus", "__name__": "pg_stat_bgwriter_checkpoints_timed_total", "instance": "metrics_exporter:9187"}}, 26 | {"time":"2023-02-14T21:41:20.18+00:00","value":15,"labels":{"job": "metrics_exporter", "group": "postgres", "server": "arbitrary_postgres:5433", "monitor": "pgDagger-prometheus", "__name__": "pg_stat_bgwriter_checkpoints_timed_total", "instance": "metrics_exporter:9187"}}, 27 | 28 | ] 29 | ``` 30 | 31 | Connect to the UI's backend postgres: 32 | 33 | ```psql 34 | psql postgres://postgres:postgres@localhost:5432/postgres 35 | ``` 36 | 37 | Query Postgres: 38 | 39 | ```sql 40 | select time, value, jsonb(labels) as labels 41 | from prom_metric.pg_locks_count psac 42 | limit 1; 43 | ``` 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /pgDagger/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | rest: 4 | image: postgrest/postgrest:v10.0.0 5 | restart: unless-stopped 6 | ports: 7 | - 3001:3000 8 | environment: 9 | PGRST_DB_URI: postgres://postgres:postgres@timescaledb:5432/postgres 10 | PGRST_DB_SCHEMA: public 11 | PGRST_DB_ANON_ROLE: postgres 12 | depends_on: 13 | - timescaledb 14 | 15 | api: 16 | image: quay.io/coredb/api:a458daf 17 | ports: 18 | - 8080:8080 19 | environment: 20 | POSTGRES_CONNECTION: postgres://postgres:postgres@timescaledb:5432/postgres 21 | command: /usr/local/bin/pgui-api 22 | depends_on: 23 | - timescaledb 24 | 25 | pgrestinit: 26 | build: 27 | context: ./scripts 28 | dockerfile: Dockerfile-pgrst.init 29 | environment: 30 | PGRST_DB_SCHEMA: public 31 | POSTGRES_CONNECTION: postgresql://postgres:postgres@timescaledb:5432/postgres 32 | depends_on: 33 | - timescaledb 34 | 35 | timescaledb: 36 | image: timescale/timescaledb-ha:pg14-latest 37 | restart: on-failure 38 | ports: 39 | - 5432:5432/tcp 40 | volumes: 41 | - timescaledb-data:/var/lib/postgresql/data 42 | environment: 43 | POSTGRES_PASSWORD: postgres 44 | POSTGRES_USER: postgres 45 | POSTGRES_DB: postgres 46 | POSTGRES_HOST_AUTH_METHOD: trust 47 | 48 | metrics_exporter: 49 | restart: always 50 | image: quay.io/prometheuscommunity/postgres-exporter:v0.11.1 51 | ports: 52 | - 9187:9187 53 | environment: 54 | DATA_SOURCE_NAME: postgresql://postgres:postgres@arbitrary_postgres:5433/postgres?sslmode=disable 55 | 56 | prometheus: 57 | image: prom/prometheus:v2.42.0 58 | restart: on-failure 59 | depends_on: 60 | - promscale 61 | ports: 62 | - 9090:9090/tcp 63 | volumes: 64 | - ${PWD}/prometheus/config/prometheus.yml:/etc/prometheus/prometheus.yml 65 | 66 | promscale: 67 | image: timescale/promscale:0.17.0 68 | restart: on-failure 69 | ports: 70 | - 9201:9201/tcp 71 | - 9202:9202/tcp 72 | depends_on: 73 | - timescaledb 74 | environment: 75 | PROMSCALE_DB_URI: postgres://postgres:postgres@timescaledb:5432/postgres?sslmode=allow 76 | 77 | grafana: 78 | image: grafana/grafana:9.3.6 79 | restart: always 80 | ports: 81 | - 3000:3000 82 | volumes: 83 | - ${PWD}/grafana/datasources:/etc/grafana/provisioning/datasources 84 | - ${PWD}/grafana/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml 85 | - ${PWD}/grafana/dashboards:/etc/grafana/extra-dashboards 86 | depends_on: 87 | - prometheus 88 | 89 | arbitrary_postgres: 90 | restart: always 91 | image: postgres:15.2 92 | ports: 93 | - 5433:5433 94 | environment: 95 | - POSTGRES_USER=postgres 96 | - POSTGRES_PASSWORD=postgres 97 | volumes: 98 | - ./postgres.conf:/etc/postgresql/postgresql.conf 99 | command: postgres -c config_file=/etc/postgresql/postgresql.conf -p 5433 100 | 101 | arbitrary_postgres_init: 102 | build: 103 | context: ./scripts 104 | dockerfile: Dockerfile-arbitrary-pg.init 105 | environment: 106 | POSTGRES_CONNECTION: postgresql://postgres:postgres@arbitrary_postgres:5433/postgres 107 | depends_on: 108 | - arbitrary_postgres 109 | 110 | volumes: 111 | timescaledb-data: 112 | -------------------------------------------------------------------------------- /pgDagger/grafana/dashboards.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | providers: 4 | - name: Default 5 | folder: Postgres 6 | type: file 7 | options: 8 | path: /etc/grafana/extra-dashboards 9 | -------------------------------------------------------------------------------- /pgDagger/grafana/datasources/prometheus.yaml: -------------------------------------------------------------------------------- 1 | datasources: 2 | - name: Prometheus 3 | type: prometheus 4 | isDefault: false 5 | url: http://prometheus:9090 6 | - name: Promscale-PromQL 7 | type: prometheus 8 | isDefault: true 9 | url: http://promscale:9201 10 | -------------------------------------------------------------------------------- /pgDagger/postgres.conf: -------------------------------------------------------------------------------- 1 | # ----------------------------- 2 | # PostgreSQL configuration file 3 | # ----------------------------- 4 | # 5 | # This file consists of lines of the form: 6 | # 7 | # name = value 8 | # 9 | # (The "=" is optional.) Whitespace may be used. Comments are introduced with 10 | # "#" anywhere on a line. The complete list of parameter names and allowed 11 | # values can be found in the PostgreSQL documentation. 12 | # 13 | # The commented-out settings shown in this file represent the default values. 14 | # Re-commenting a setting is NOT sufficient to revert it to the default value; 15 | # you need to reload the server. 16 | # 17 | # This file is read on server startup and when the server receives a SIGHUP 18 | # signal. If you edit the file on a running system, you have to SIGHUP the 19 | # server for the changes to take effect, run "pg_ctl reload", or execute 20 | # "SELECT pg_reload_conf()". Some parameters, which are marked below, 21 | # require a server shutdown and restart to take effect. 22 | # 23 | # Any parameter can also be given as a command-line option to the server, e.g., 24 | # "postgres -c log_connections=on". Some parameters can be changed at run time 25 | # with the "SET" SQL command. 26 | # 27 | # Memory units: B = bytes Time units: us = microseconds 28 | # kB = kilobytes ms = milliseconds 29 | # MB = megabytes s = seconds 30 | # GB = gigabytes min = minutes 31 | # TB = terabytes h = hours 32 | # d = days 33 | 34 | 35 | #------------------------------------------------------------------------------ 36 | # FILE LOCATIONS 37 | #------------------------------------------------------------------------------ 38 | 39 | # The default values of these variables are driven from the -D command-line 40 | # option or PGDATA environment variable, represented here as ConfigDir. 41 | 42 | #data_directory = 'ConfigDir' # use data in another directory 43 | # (change requires restart) 44 | #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file 45 | # (change requires restart) 46 | #ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file 47 | # (change requires restart) 48 | 49 | # If external_pid_file is not explicitly set, no extra PID file is written. 50 | #external_pid_file = '' # write an extra PID file 51 | # (change requires restart) 52 | 53 | 54 | #------------------------------------------------------------------------------ 55 | # CONNECTIONS AND AUTHENTICATION 56 | #------------------------------------------------------------------------------ 57 | 58 | # - Connection Settings - 59 | 60 | listen_addresses = '*' 61 | # comma-separated list of addresses; 62 | # defaults to 'localhost'; use '*' for all 63 | # (change requires restart) 64 | #port = 5432 # (change requires restart) 65 | #max_connections = 100 # (change requires restart) 66 | #superuser_reserved_connections = 3 # (change requires restart) 67 | #unix_socket_directories = '/tmp' # comma-separated list of directories 68 | # (change requires restart) 69 | #unix_socket_group = '' # (change requires restart) 70 | #unix_socket_permissions = 0777 # begin with 0 to use octal notation 71 | # (change requires restart) 72 | #bonjour = off # advertise server via Bonjour 73 | # (change requires restart) 74 | #bonjour_name = '' # defaults to the computer name 75 | # (change requires restart) 76 | 77 | # - TCP settings - 78 | # see "man tcp" for details 79 | 80 | #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; 81 | # 0 selects the system default 82 | #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; 83 | # 0 selects the system default 84 | #tcp_keepalives_count = 0 # TCP_KEEPCNT; 85 | # 0 selects the system default 86 | #tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds; 87 | # 0 selects the system default 88 | 89 | #client_connection_check_interval = 0 # time between checks for client 90 | # disconnection while running queries; 91 | # 0 for never 92 | 93 | # - Authentication - 94 | 95 | #authentication_timeout = 1min # 1s-600s 96 | #password_encryption = scram-sha-256 # scram-sha-256 or md5 97 | #db_user_namespace = off 98 | 99 | # GSSAPI using Kerberos 100 | #krb_server_keyfile = 'FILE:${sysconfdir}/krb5.keytab' 101 | #krb_caseins_users = off 102 | 103 | # - SSL - 104 | 105 | #ssl = off 106 | #ssl_ca_file = '' 107 | #ssl_cert_file = 'server.crt' 108 | #ssl_crl_file = '' 109 | #ssl_crl_dir = '' 110 | #ssl_key_file = 'server.key' 111 | #ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers 112 | #ssl_prefer_server_ciphers = on 113 | #ssl_ecdh_curve = 'prime256v1' 114 | #ssl_min_protocol_version = 'TLSv1.2' 115 | #ssl_max_protocol_version = '' 116 | #ssl_dh_params_file = '' 117 | #ssl_passphrase_command = '' 118 | #ssl_passphrase_command_supports_reload = off 119 | 120 | 121 | #------------------------------------------------------------------------------ 122 | # RESOURCE USAGE (except WAL) 123 | #------------------------------------------------------------------------------ 124 | 125 | # - Memory - 126 | 127 | #shared_buffers = 128MB # min 128kB 128 | # (change requires restart) 129 | #huge_pages = try # on, off, or try 130 | # (change requires restart) 131 | #huge_page_size = 0 # zero for system default 132 | # (change requires restart) 133 | #temp_buffers = 8MB # min 800kB 134 | #max_prepared_transactions = 0 # zero disables the feature 135 | # (change requires restart) 136 | # Caution: it is not advisable to set max_prepared_transactions nonzero unless 137 | # you actively intend to use prepared transactions. 138 | #work_mem = 4MB # min 64kB 139 | #hash_mem_multiplier = 2.0 # 1-1000.0 multiplier on hash table work_mem 140 | #maintenance_work_mem = 64MB # min 1MB 141 | #autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem 142 | #logical_decoding_work_mem = 64MB # min 64kB 143 | #max_stack_depth = 2MB # min 100kB 144 | #shared_memory_type = mmap # the default is the first option 145 | # supported by the operating system: 146 | # mmap 147 | # sysv 148 | # windows 149 | # (change requires restart) 150 | #dynamic_shared_memory_type = posix # the default is usually the first option 151 | # supported by the operating system: 152 | # posix 153 | # sysv 154 | # windows 155 | # mmap 156 | # (change requires restart) 157 | #min_dynamic_shared_memory = 0MB # (change requires restart) 158 | 159 | # - Disk - 160 | 161 | #temp_file_limit = -1 # limits per-process temp file space 162 | # in kilobytes, or -1 for no limit 163 | 164 | # - Kernel Resources - 165 | 166 | #max_files_per_process = 1000 # min 64 167 | # (change requires restart) 168 | 169 | # - Cost-Based Vacuum Delay - 170 | 171 | #vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables) 172 | #vacuum_cost_page_hit = 1 # 0-10000 credits 173 | #vacuum_cost_page_miss = 2 # 0-10000 credits 174 | #vacuum_cost_page_dirty = 20 # 0-10000 credits 175 | #vacuum_cost_limit = 200 # 1-10000 credits 176 | 177 | # - Background Writer - 178 | 179 | #bgwriter_delay = 200ms # 10-10000ms between rounds 180 | #bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables 181 | #bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round 182 | #bgwriter_flush_after = 0 # measured in pages, 0 disables 183 | 184 | # - Asynchronous Behavior - 185 | 186 | #backend_flush_after = 0 # measured in pages, 0 disables 187 | #effective_io_concurrency = 1 # 1-1000; 0 disables prefetching 188 | #maintenance_io_concurrency = 10 # 1-1000; 0 disables prefetching 189 | #max_worker_processes = 8 # (change requires restart) 190 | #max_parallel_workers_per_gather = 2 # taken from max_parallel_workers 191 | #max_parallel_maintenance_workers = 2 # taken from max_parallel_workers 192 | #max_parallel_workers = 8 # maximum number of max_worker_processes that 193 | # can be used in parallel operations 194 | #parallel_leader_participation = on 195 | #old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate 196 | # (change requires restart) 197 | 198 | 199 | #------------------------------------------------------------------------------ 200 | # WRITE-AHEAD LOG 201 | #------------------------------------------------------------------------------ 202 | 203 | # - Settings - 204 | 205 | #wal_level = replica # minimal, replica, or logical 206 | # (change requires restart) 207 | #fsync = on # flush data to disk for crash safety 208 | # (turning this off can cause 209 | # unrecoverable data corruption) 210 | #synchronous_commit = on # synchronization level; 211 | # off, local, remote_write, remote_apply, or on 212 | #wal_sync_method = fsync # the default is the first option 213 | # supported by the operating system: 214 | # open_datasync 215 | # fdatasync (default on Linux and FreeBSD) 216 | # fsync 217 | # fsync_writethrough 218 | # open_sync 219 | #full_page_writes = on # recover from partial page writes 220 | #wal_log_hints = off # also do full page writes of non-critical updates 221 | # (change requires restart) 222 | #wal_compression = off # enables compression of full-page writes; 223 | # off, pglz, lz4, zstd, or on 224 | #wal_init_zero = on # zero-fill new WAL files 225 | #wal_recycle = on # recycle WAL files 226 | #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers 227 | # (change requires restart) 228 | #wal_writer_delay = 200ms # 1-10000 milliseconds 229 | #wal_writer_flush_after = 1MB # measured in pages, 0 disables 230 | #wal_skip_threshold = 2MB 231 | 232 | #commit_delay = 0 # range 0-100000, in microseconds 233 | #commit_siblings = 5 # range 1-1000 234 | 235 | # - Checkpoints - 236 | 237 | #checkpoint_timeout = 5min # range 30s-1d 238 | #checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0 239 | #checkpoint_flush_after = 0 # measured in pages, 0 disables 240 | #checkpoint_warning = 30s # 0 disables 241 | #max_wal_size = 1GB 242 | #min_wal_size = 80MB 243 | 244 | # - Prefetching during recovery - 245 | 246 | #recovery_prefetch = try # prefetch pages referenced in the WAL? 247 | #wal_decode_buffer_size = 512kB # lookahead window used for prefetching 248 | # (change requires restart) 249 | 250 | # - Archiving - 251 | 252 | #archive_mode = off # enables archiving; off, on, or always 253 | # (change requires restart) 254 | #archive_library = '' # library to use to archive a logfile segment 255 | # (empty string indicates archive_command should 256 | # be used) 257 | #archive_command = '' # command to use to archive a logfile segment 258 | # placeholders: %p = path of file to archive 259 | # %f = file name only 260 | # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' 261 | #archive_timeout = 0 # force a logfile segment switch after this 262 | # number of seconds; 0 disables 263 | 264 | # - Archive Recovery - 265 | 266 | # These are only used in recovery mode. 267 | 268 | #restore_command = '' # command to use to restore an archived logfile segment 269 | # placeholders: %p = path of file to restore 270 | # %f = file name only 271 | # e.g. 'cp /mnt/server/archivedir/%f %p' 272 | #archive_cleanup_command = '' # command to execute at every restartpoint 273 | #recovery_end_command = '' # command to execute at completion of recovery 274 | 275 | # - Recovery Target - 276 | 277 | # Set these only when performing a targeted recovery. 278 | 279 | #recovery_target = '' # 'immediate' to end recovery as soon as a 280 | # consistent state is reached 281 | # (change requires restart) 282 | #recovery_target_name = '' # the named restore point to which recovery will proceed 283 | # (change requires restart) 284 | #recovery_target_time = '' # the time stamp up to which recovery will proceed 285 | # (change requires restart) 286 | #recovery_target_xid = '' # the transaction ID up to which recovery will proceed 287 | # (change requires restart) 288 | #recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed 289 | # (change requires restart) 290 | #recovery_target_inclusive = on # Specifies whether to stop: 291 | # just after the specified recovery target (on) 292 | # just before the recovery target (off) 293 | # (change requires restart) 294 | #recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID 295 | # (change requires restart) 296 | #recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown' 297 | # (change requires restart) 298 | 299 | 300 | #------------------------------------------------------------------------------ 301 | # REPLICATION 302 | #------------------------------------------------------------------------------ 303 | 304 | # - Sending Servers - 305 | 306 | # Set these on the primary and on any standby that will send replication data. 307 | 308 | #max_wal_senders = 10 # max number of walsender processes 309 | # (change requires restart) 310 | #max_replication_slots = 10 # max number of replication slots 311 | # (change requires restart) 312 | #wal_keep_size = 0 # in megabytes; 0 disables 313 | #max_slot_wal_keep_size = -1 # in megabytes; -1 disables 314 | #wal_sender_timeout = 60s # in milliseconds; 0 disables 315 | #track_commit_timestamp = off # collect timestamp of transaction commit 316 | # (change requires restart) 317 | 318 | # - Primary Server - 319 | 320 | # These settings are ignored on a standby server. 321 | 322 | #synchronous_standby_names = '' # standby servers that provide sync rep 323 | # method to choose sync standbys, number of sync standbys, 324 | # and comma-separated list of application_name 325 | # from standby(s); '*' = all 326 | #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed 327 | 328 | # - Standby Servers - 329 | 330 | # These settings are ignored on a primary server. 331 | 332 | #primary_conninfo = '' # connection string to sending server 333 | #primary_slot_name = '' # replication slot on sending server 334 | #promote_trigger_file = '' # file name whose presence ends recovery 335 | #hot_standby = on # "off" disallows queries during recovery 336 | # (change requires restart) 337 | #max_standby_archive_delay = 30s # max delay before canceling queries 338 | # when reading WAL from archive; 339 | # -1 allows indefinite delay 340 | #max_standby_streaming_delay = 30s # max delay before canceling queries 341 | # when reading streaming WAL; 342 | # -1 allows indefinite delay 343 | #wal_receiver_create_temp_slot = off # create temp slot if primary_slot_name 344 | # is not set 345 | #wal_receiver_status_interval = 10s # send replies at least this often 346 | # 0 disables 347 | #hot_standby_feedback = off # send info from standby to prevent 348 | # query conflicts 349 | #wal_receiver_timeout = 60s # time that receiver waits for 350 | # communication from primary 351 | # in milliseconds; 0 disables 352 | #wal_retrieve_retry_interval = 5s # time to wait before retrying to 353 | # retrieve WAL after a failed attempt 354 | #recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery 355 | 356 | # - Subscribers - 357 | 358 | # These settings are ignored on a publisher. 359 | 360 | #max_logical_replication_workers = 4 # taken from max_worker_processes 361 | # (change requires restart) 362 | #max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers 363 | 364 | 365 | #------------------------------------------------------------------------------ 366 | # QUERY TUNING 367 | #------------------------------------------------------------------------------ 368 | 369 | # - Planner Method Configuration - 370 | 371 | #enable_async_append = on 372 | #enable_bitmapscan = on 373 | #enable_gathermerge = on 374 | #enable_hashagg = on 375 | #enable_hashjoin = on 376 | #enable_incremental_sort = on 377 | #enable_indexscan = on 378 | #enable_indexonlyscan = on 379 | #enable_material = on 380 | #enable_memoize = on 381 | #enable_mergejoin = on 382 | #enable_nestloop = on 383 | #enable_parallel_append = on 384 | #enable_parallel_hash = on 385 | #enable_partition_pruning = on 386 | #enable_partitionwise_join = off 387 | #enable_partitionwise_aggregate = off 388 | #enable_seqscan = on 389 | #enable_sort = on 390 | #enable_tidscan = on 391 | 392 | # - Planner Cost Constants - 393 | 394 | #seq_page_cost = 1.0 # measured on an arbitrary scale 395 | #random_page_cost = 4.0 # same scale as above 396 | #cpu_tuple_cost = 0.01 # same scale as above 397 | #cpu_index_tuple_cost = 0.005 # same scale as above 398 | #cpu_operator_cost = 0.0025 # same scale as above 399 | #parallel_setup_cost = 1000.0 # same scale as above 400 | #parallel_tuple_cost = 0.1 # same scale as above 401 | #min_parallel_table_scan_size = 8MB 402 | #min_parallel_index_scan_size = 512kB 403 | #effective_cache_size = 4GB 404 | 405 | #jit_above_cost = 100000 # perform JIT compilation if available 406 | # and query more expensive than this; 407 | # -1 disables 408 | #jit_inline_above_cost = 500000 # inline small functions if query is 409 | # more expensive than this; -1 disables 410 | #jit_optimize_above_cost = 500000 # use expensive JIT optimizations if 411 | # query is more expensive than this; 412 | # -1 disables 413 | 414 | # - Genetic Query Optimizer - 415 | 416 | #geqo = on 417 | #geqo_threshold = 12 418 | #geqo_effort = 5 # range 1-10 419 | #geqo_pool_size = 0 # selects default based on effort 420 | #geqo_generations = 0 # selects default based on effort 421 | #geqo_selection_bias = 2.0 # range 1.5-2.0 422 | #geqo_seed = 0.0 # range 0.0-1.0 423 | 424 | # - Other Planner Options - 425 | 426 | #default_statistics_target = 100 # range 1-10000 427 | #constraint_exclusion = partition # on, off, or partition 428 | #cursor_tuple_fraction = 0.1 # range 0.0-1.0 429 | #from_collapse_limit = 8 430 | #jit = on # allow JIT compilation 431 | #join_collapse_limit = 8 # 1 disables collapsing of explicit 432 | # JOIN clauses 433 | #plan_cache_mode = auto # auto, force_generic_plan or 434 | # force_custom_plan 435 | #recursive_worktable_factor = 10.0 # range 0.001-1000000 436 | 437 | 438 | #------------------------------------------------------------------------------ 439 | # REPORTING AND LOGGING 440 | #------------------------------------------------------------------------------ 441 | 442 | # - Where to Log - 443 | 444 | #log_destination = 'stderr' # Valid values are combinations of 445 | # stderr, csvlog, jsonlog, syslog, and 446 | # eventlog, depending on platform. 447 | # csvlog and jsonlog require 448 | # logging_collector to be on. 449 | 450 | # This is used when logging to stderr: 451 | #logging_collector = off # Enable capturing of stderr, jsonlog, 452 | # and csvlog into log files. Required 453 | # to be on for csvlogs and jsonlogs. 454 | # (change requires restart) 455 | 456 | # These are only used if logging_collector is on: 457 | #log_directory = 'log' # directory where log files are written, 458 | # can be absolute or relative to PGDATA 459 | #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, 460 | # can include strftime() escapes 461 | #log_file_mode = 0600 # creation mode for log files, 462 | # begin with 0 to use octal notation 463 | #log_rotation_age = 1d # Automatic rotation of logfiles will 464 | # happen after that time. 0 disables. 465 | #log_rotation_size = 10MB # Automatic rotation of logfiles will 466 | # happen after that much log output. 467 | # 0 disables. 468 | #log_truncate_on_rotation = off # If on, an existing log file with the 469 | # same name as the new log file will be 470 | # truncated rather than appended to. 471 | # But such truncation only occurs on 472 | # time-driven rotation, not on restarts 473 | # or size-driven rotation. Default is 474 | # off, meaning append to existing files 475 | # in all cases. 476 | 477 | # These are relevant when logging to syslog: 478 | #syslog_facility = 'LOCAL0' 479 | #syslog_ident = 'postgres' 480 | #syslog_sequence_numbers = on 481 | #syslog_split_messages = on 482 | 483 | # This is only relevant when logging to eventlog (Windows): 484 | # (change requires restart) 485 | #event_source = 'PostgreSQL' 486 | 487 | # - When to Log - 488 | 489 | #log_min_messages = warning # values in order of decreasing detail: 490 | # debug5 491 | # debug4 492 | # debug3 493 | # debug2 494 | # debug1 495 | # info 496 | # notice 497 | # warning 498 | # error 499 | # log 500 | # fatal 501 | # panic 502 | 503 | #log_min_error_statement = error # values in order of decreasing detail: 504 | # debug5 505 | # debug4 506 | # debug3 507 | # debug2 508 | # debug1 509 | # info 510 | # notice 511 | # warning 512 | # error 513 | # log 514 | # fatal 515 | # panic (effectively off) 516 | 517 | #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements 518 | # and their durations, > 0 logs only 519 | # statements running at least this number 520 | # of milliseconds 521 | 522 | #log_min_duration_sample = -1 # -1 is disabled, 0 logs a sample of statements 523 | # and their durations, > 0 logs only a sample of 524 | # statements running at least this number 525 | # of milliseconds; 526 | # sample fraction is determined by log_statement_sample_rate 527 | 528 | #log_statement_sample_rate = 1.0 # fraction of logged statements exceeding 529 | # log_min_duration_sample to be logged; 530 | # 1.0 logs all such statements, 0.0 never logs 531 | 532 | 533 | #log_transaction_sample_rate = 0.0 # fraction of transactions whose statements 534 | # are logged regardless of their duration; 1.0 logs all 535 | # statements from all transactions, 0.0 never logs 536 | 537 | #log_startup_progress_interval = 10s # Time between progress updates for 538 | # long-running startup operations. 539 | # 0 disables the feature, > 0 indicates 540 | # the interval in milliseconds. 541 | 542 | # - What to Log - 543 | 544 | #debug_print_parse = off 545 | #debug_print_rewritten = off 546 | #debug_print_plan = off 547 | #debug_pretty_print = on 548 | #log_autovacuum_min_duration = 10min # log autovacuum activity; 549 | # -1 disables, 0 logs all actions and 550 | # their durations, > 0 logs only 551 | # actions running at least this number 552 | # of milliseconds. 553 | #log_checkpoints = on 554 | #log_connections = off 555 | #log_disconnections = off 556 | #log_duration = off 557 | #log_error_verbosity = default # terse, default, or verbose messages 558 | #log_hostname = off 559 | #log_line_prefix = '%m [%p] ' # special values: 560 | # %a = application name 561 | # %u = user name 562 | # %d = database name 563 | # %r = remote host and port 564 | # %h = remote host 565 | # %b = backend type 566 | # %p = process ID 567 | # %P = process ID of parallel group leader 568 | # %t = timestamp without milliseconds 569 | # %m = timestamp with milliseconds 570 | # %n = timestamp with milliseconds (as a Unix epoch) 571 | # %Q = query ID (0 if none or not computed) 572 | # %i = command tag 573 | # %e = SQL state 574 | # %c = session ID 575 | # %l = session line number 576 | # %s = session start timestamp 577 | # %v = virtual transaction ID 578 | # %x = transaction ID (0 if none) 579 | # %q = stop here in non-session 580 | # processes 581 | # %% = '%' 582 | # e.g. '<%u%%%d> ' 583 | #log_lock_waits = off # log lock waits >= deadlock_timeout 584 | #log_recovery_conflict_waits = off # log standby recovery conflict waits 585 | # >= deadlock_timeout 586 | #log_parameter_max_length = -1 # when logging statements, limit logged 587 | # bind-parameter values to N bytes; 588 | # -1 means print in full, 0 disables 589 | #log_parameter_max_length_on_error = 0 # when logging an error, limit logged 590 | # bind-parameter values to N bytes; 591 | # -1 means print in full, 0 disables 592 | #log_statement = 'none' # none, ddl, mod, all 593 | #log_replication_commands = off 594 | #log_temp_files = -1 # log temporary files equal or larger 595 | # than the specified size in kilobytes; 596 | # -1 disables, 0 logs all temp files 597 | #log_timezone = 'GMT' 598 | 599 | 600 | #------------------------------------------------------------------------------ 601 | # PROCESS TITLE 602 | #------------------------------------------------------------------------------ 603 | 604 | #cluster_name = '' # added to process titles if nonempty 605 | # (change requires restart) 606 | #update_process_title = on 607 | 608 | 609 | #------------------------------------------------------------------------------ 610 | # STATISTICS 611 | #------------------------------------------------------------------------------ 612 | 613 | # - Cumulative Query and Index Statistics - 614 | 615 | #track_activities = on 616 | #track_activity_query_size = 1024 # (change requires restart) 617 | #track_counts = on 618 | #track_io_timing = off 619 | #track_wal_io_timing = off 620 | #track_functions = none # none, pl, all 621 | #stats_fetch_consistency = cache 622 | 623 | 624 | # - Monitoring - 625 | 626 | #compute_query_id = auto 627 | #log_statement_stats = off 628 | #log_parser_stats = off 629 | #log_planner_stats = off 630 | #log_executor_stats = off 631 | 632 | 633 | #------------------------------------------------------------------------------ 634 | # AUTOVACUUM 635 | #------------------------------------------------------------------------------ 636 | 637 | #autovacuum = on # Enable autovacuum subprocess? 'on' 638 | # requires track_counts to also be on. 639 | #autovacuum_max_workers = 3 # max number of autovacuum subprocesses 640 | # (change requires restart) 641 | #autovacuum_naptime = 1min # time between autovacuum runs 642 | #autovacuum_vacuum_threshold = 50 # min number of row updates before 643 | # vacuum 644 | #autovacuum_vacuum_insert_threshold = 1000 # min number of row inserts 645 | # before vacuum; -1 disables insert 646 | # vacuums 647 | #autovacuum_analyze_threshold = 50 # min number of row updates before 648 | # analyze 649 | #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum 650 | #autovacuum_vacuum_insert_scale_factor = 0.2 # fraction of inserts over table 651 | # size before insert vacuum 652 | #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze 653 | #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum 654 | # (change requires restart) 655 | #autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age 656 | # before forced vacuum 657 | # (change requires restart) 658 | #autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for 659 | # autovacuum, in milliseconds; 660 | # -1 means use vacuum_cost_delay 661 | #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for 662 | # autovacuum, -1 means use 663 | # vacuum_cost_limit 664 | 665 | 666 | #------------------------------------------------------------------------------ 667 | # CLIENT CONNECTION DEFAULTS 668 | #------------------------------------------------------------------------------ 669 | 670 | # - Statement Behavior - 671 | 672 | #client_min_messages = notice # values in order of decreasing detail: 673 | # debug5 674 | # debug4 675 | # debug3 676 | # debug2 677 | # debug1 678 | # log 679 | # notice 680 | # warning 681 | # error 682 | #search_path = '"$user", public' # schema names 683 | #row_security = on 684 | #default_table_access_method = 'heap' 685 | #default_tablespace = '' # a tablespace name, '' uses the default 686 | #default_toast_compression = 'pglz' # 'pglz' or 'lz4' 687 | #temp_tablespaces = '' # a list of tablespace names, '' uses 688 | # only default tablespace 689 | #check_function_bodies = on 690 | #default_transaction_isolation = 'read committed' 691 | #default_transaction_read_only = off 692 | #default_transaction_deferrable = off 693 | #session_replication_role = 'origin' 694 | #statement_timeout = 0 # in milliseconds, 0 is disabled 695 | #lock_timeout = 0 # in milliseconds, 0 is disabled 696 | #idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled 697 | #idle_session_timeout = 0 # in milliseconds, 0 is disabled 698 | #vacuum_freeze_table_age = 150000000 699 | #vacuum_freeze_min_age = 50000000 700 | #vacuum_failsafe_age = 1600000000 701 | #vacuum_multixact_freeze_table_age = 150000000 702 | #vacuum_multixact_freeze_min_age = 5000000 703 | #vacuum_multixact_failsafe_age = 1600000000 704 | #bytea_output = 'hex' # hex, escape 705 | #xmlbinary = 'base64' 706 | #xmloption = 'content' 707 | #gin_pending_list_limit = 4MB 708 | 709 | # - Locale and Formatting - 710 | 711 | #datestyle = 'iso, mdy' 712 | #intervalstyle = 'postgres' 713 | #timezone = 'GMT' 714 | #timezone_abbreviations = 'Default' # Select the set of available time zone 715 | # abbreviations. Currently, there are 716 | # Default 717 | # Australia (historical usage) 718 | # India 719 | # You can create your own file in 720 | # share/timezonesets/. 721 | #extra_float_digits = 1 # min -15, max 3; any value >0 actually 722 | # selects precise output mode 723 | #client_encoding = sql_ascii # actually, defaults to database 724 | # encoding 725 | 726 | # These settings are initialized by initdb, but they can be changed. 727 | #lc_messages = 'C' # locale for system error message 728 | # strings 729 | #lc_monetary = 'C' # locale for monetary formatting 730 | #lc_numeric = 'C' # locale for number formatting 731 | #lc_time = 'C' # locale for time formatting 732 | 733 | # default configuration for text search 734 | #default_text_search_config = 'pg_catalog.simple' 735 | 736 | # - Shared Library Preloading - 737 | 738 | #local_preload_libraries = '' 739 | #session_preload_libraries = '' 740 | shared_preload_libraries = 'pg_stat_statements' # (change requires restart) 741 | #jit_provider = 'llvmjit' # JIT library to use 742 | 743 | # - Other Defaults - 744 | 745 | #dynamic_library_path = '$libdir' 746 | #extension_destdir = '' # prepend path when loading extensions 747 | # and shared objects (added by Debian) 748 | #gin_fuzzy_search_limit = 0 749 | 750 | 751 | #------------------------------------------------------------------------------ 752 | # LOCK MANAGEMENT 753 | #------------------------------------------------------------------------------ 754 | 755 | #deadlock_timeout = 1s 756 | #max_locks_per_transaction = 64 # min 10 757 | # (change requires restart) 758 | #max_pred_locks_per_transaction = 64 # min 10 759 | # (change requires restart) 760 | #max_pred_locks_per_relation = -2 # negative values mean 761 | # (max_pred_locks_per_transaction 762 | # / -max_pred_locks_per_relation) - 1 763 | #max_pred_locks_per_page = 2 # min 0 764 | 765 | 766 | #------------------------------------------------------------------------------ 767 | # VERSION AND PLATFORM COMPATIBILITY 768 | #------------------------------------------------------------------------------ 769 | 770 | # - Previous PostgreSQL Versions - 771 | 772 | #array_nulls = on 773 | #backslash_quote = safe_encoding # on, off, or safe_encoding 774 | #escape_string_warning = on 775 | #lo_compat_privileges = off 776 | #quote_all_identifiers = off 777 | #standard_conforming_strings = on 778 | #synchronize_seqscans = on 779 | 780 | # - Other Platforms and Clients - 781 | 782 | #transform_null_equals = off 783 | 784 | 785 | #------------------------------------------------------------------------------ 786 | # ERROR HANDLING 787 | #------------------------------------------------------------------------------ 788 | 789 | #exit_on_error = off # terminate session on any error? 790 | #restart_after_crash = on # reinitialize after backend crash? 791 | #data_sync_retry = off # retry or panic on failure to fsync 792 | # data? 793 | # (change requires restart) 794 | #recovery_init_sync_method = fsync # fsync, syncfs (Linux 5.8+) 795 | 796 | 797 | #------------------------------------------------------------------------------ 798 | # CONFIG FILE INCLUDES 799 | #------------------------------------------------------------------------------ 800 | 801 | # These options allow settings to be loaded from files other than the 802 | # default postgresql.conf. Note that these are directives, not variable 803 | # assignments, so they can usefully be given more than once. 804 | 805 | #include_dir = '...' # include files ending in '.conf' from 806 | # a directory, e.g., 'conf.d' 807 | #include_if_exists = '...' # include file only if it exists 808 | #include = '...' # include file 809 | 810 | 811 | #------------------------------------------------------------------------------ 812 | # CUSTOMIZED OPTIONS 813 | #------------------------------------------------------------------------------ 814 | 815 | # Add settings for extensions here 816 | -------------------------------------------------------------------------------- /pgDagger/prometheus/config/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tembo-io/pgUI/25820ca92fe1ef86ce2877734b0ff750cd2247e9/pgDagger/prometheus/config/Makefile -------------------------------------------------------------------------------- /pgDagger/prometheus/config/prometheus.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | evaluation_interval: 15s # By default, scrape targets every 15 seconds. 4 | # scrape_timeout is set to the global default (10s). 5 | 6 | # Attach these labels to any time series or alerts when communicating with 7 | # external systems (federation, remote storage, Alertmanager). 8 | external_labels: 9 | monitor: "pgDagger-prometheus" 10 | 11 | # Load and evaluate rules in this file every 'evaluation_interval' seconds. 12 | # rule_files: 13 | # - "../alert/alert.yml" 14 | 15 | # A scrape configuration containing exactly one endpoint to scrape: 16 | # Here it's Prometheus itself. 17 | scrape_configs: 18 | # The job name is added as a label `job=` to any timeseries scraped from this config. 19 | 20 | - job_name: "prometheus" 21 | # Override the global default and scrape targets from this job every 5 seconds. 22 | scrape_interval: 5s 23 | static_configs: 24 | - targets: ["localhost:9090"] 25 | 26 | - job_name: "metrics_exporter" 27 | # metrics_path defaults to '/metrics' 28 | # scheme defaults to 'http'. 29 | scrape_interval: 5s 30 | static_configs: 31 | - targets: ["metrics_exporter:9187"] 32 | labels: 33 | group: 'postgres' 34 | 35 | - job_name: promscale 36 | static_configs: 37 | - targets: ['promscale:9201'] 38 | 39 | # alerting:docker 40 | # alertmanagers: 41 | # - scheme: http 42 | # static_configs: 43 | # - targets: 44 | # - "alertmanager:9093" 45 | 46 | remote_write: 47 | - url: "http://promscale:9201/write" 48 | remote_timeout: 100s 49 | queue_config: 50 | max_samples_per_send: 10000 51 | 52 | 53 | remote_read: 54 | - url: "http://promscale:9201/read" 55 | read_recent: true -------------------------------------------------------------------------------- /pgDagger/scripts/Dockerfile-arbitrary-pg.init: -------------------------------------------------------------------------------- 1 | FROM python:3.11.2-slim-bullseye 2 | 3 | RUN pip3 install psycopg2-binary sqlalchemy tenacity 4 | 5 | COPY arbitrary_pg_init.py . 6 | 7 | CMD python3 arbitrary_pg_init.py 8 | -------------------------------------------------------------------------------- /pgDagger/scripts/Dockerfile-pgrst.init: -------------------------------------------------------------------------------- 1 | FROM python:3.11.2-slim-bullseye 2 | 3 | RUN pip3 install psycopg2-binary sqlalchemy tenacity 4 | 5 | COPY pgrst_init.py . 6 | 7 | CMD python3 pgrst_init.py 8 | -------------------------------------------------------------------------------- /pgDagger/scripts/arbitrary_pg_init.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | from sqlalchemy import create_engine, text 5 | from tenacity import retry, stop_after_attempt, wait_fixed 6 | 7 | POSTGRES_CONNECTION = os.getenv("POSTGRES_CONNECTION", "postgresql://postgres:postgres@0.0.0.0:5433/postgres") 8 | 9 | logging.basicConfig(level=logging.DEBUG) 10 | 11 | # retry 5 times, wait 2 seconds between each retry 12 | @retry(stop=stop_after_attempt(5), wait=wait_fixed(2)) 13 | def create_extensions(): 14 | engine = create_engine(POSTGRES_CONNECTION) 15 | query = "CREATE EXTENSION pg_stat_statements" 16 | with engine.connect() as con: 17 | con.execute(text(query)) 18 | con.commit() 19 | logging.info("created extension pg_stat_statements") 20 | 21 | if __name__ == "__main__": 22 | logging.info("Creating extensions for arbitrary postgres") 23 | create_extensions() 24 | -------------------------------------------------------------------------------- /pgDagger/scripts/pgrst_init.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | from sqlalchemy import create_engine, text 5 | from tenacity import retry, stop_after_attempt, wait_fixed 6 | 7 | POSTGRES_CONNECTION = os.getenv("POSTGRES_CONNECTION", "postgresql://postgres:postgres@0.0.0.0:5432/postgres") 8 | SCHEMA = os.getenv("PGRST_DB_SCHEMA", "public") 9 | 10 | logging.basicConfig(level=logging.DEBUG) 11 | 12 | # retry 5 times, wait 2 seconds between each retry 13 | @retry(stop=stop_after_attempt(10), wait=wait_fixed(10)) 14 | def initialize() -> list[str]: 15 | engine = create_engine(POSTGRES_CONNECTION) 16 | 17 | with engine.connect() as con: 18 | prom_metric_tables = con.execute(text(f""" 19 | SELECT table_name 20 | FROM information_schema.tables 21 | WHERE table_schema = 'prom_metric' 22 | """)).fetchall() 23 | 24 | if len(prom_metric_tables) < 300: 25 | # promscale likely not done initializing 26 | # let retry logic handle it 27 | msg = "No prometheus data tables found, retrying..." 28 | logging.warning(msg) 29 | raise Exception(msg) 30 | 31 | # filter to only "pg_ tables" 32 | tables = [t[0] for t in prom_metric_tables if "pg_" in t[0]] 33 | logging.debug(f"prom_metric_tables: {tables}") 34 | return tables 35 | 36 | def create_views(tables): 37 | engine = create_engine(POSTGRES_CONNECTION) 38 | for table_name in tables: 39 | query = f""" 40 | CREATE OR REPLACE VIEW {SCHEMA}.prom_{table_name} as 41 | SELECT 42 | time, value, jsonb(labels) as labels 43 | FROM 44 | prom_metric.{table_name} 45 | """ 46 | with engine.connect() as con: 47 | con.execute(text(query)) 48 | con.commit() 49 | logging.info(f"created view for table {table_name}") 50 | 51 | if __name__ == "__main__": 52 | logging.info("Creating views for prometheus data tables") 53 | tables = initialize() 54 | create_views(tables) 55 | -------------------------------------------------------------------------------- /pgUI/.babelrc.json: -------------------------------------------------------------------------------- 1 | // storybook req 2 | { 3 | "sourceType": "unambiguous", 4 | "presets": [ 5 | [ 6 | "@babel/preset-env", 7 | { 8 | "targets": { 9 | "chrome": 100 10 | } 11 | } 12 | ], 13 | "@babel/preset-typescript", 14 | "@babel/preset-react" 15 | ], 16 | "plugins": [] 17 | } 18 | -------------------------------------------------------------------------------- /pgUI/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | 38 | # storybook 39 | storybook-static 40 | -------------------------------------------------------------------------------- /pgUI/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 2, 4 | "semi": true, 5 | "singleQuote": true, 6 | "bracketSameLine": true 7 | } 8 | -------------------------------------------------------------------------------- /pgUI/.storybook/main.ts: -------------------------------------------------------------------------------- 1 | import type { StorybookConfig } from '@storybook/react-webpack5'; 2 | const config: StorybookConfig = { 3 | stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'], 4 | addons: [ 5 | '@storybook/addon-links', 6 | '@storybook/addon-essentials', 7 | '@storybook/addon-interactions', 8 | '@storybook/preset-scss', 9 | ], 10 | framework: { 11 | name: '@storybook/react-webpack5', 12 | options: {}, 13 | }, 14 | docs: { 15 | autodocs: 'tag', 16 | }, 17 | }; 18 | export default config; 19 | -------------------------------------------------------------------------------- /pgUI/.storybook/preview.ts: -------------------------------------------------------------------------------- 1 | import '../styles/globals.scss'; 2 | 3 | export const parameters = { 4 | backgrounds: { 5 | default: 'light', 6 | }, 7 | actions: { argTypesRegex: '^on[A-Z].*' }, 8 | controls: { 9 | matchers: { 10 | color: /(background|color)$/i, 11 | date: /Date$/, 12 | }, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /pgUI/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2023 CoreDB, Inc. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /pgUI/README.md: -------------------------------------------------------------------------------- 1 | # pgUI 2 | 3 | pgUI is an open-source, extensible web UI for Postgres and Postgres extensions. 4 | 5 | Start Nextjs 6 | 7 | ``` 8 | npm install 9 | npm run dev 10 | ``` 11 | 12 | ### Component Library via Storybook 13 | 14 | ``` 15 | npm run storybook 16 | ``` 17 | -------------------------------------------------------------------------------- /pgUI/components/Button/Button.module.scss: -------------------------------------------------------------------------------- 1 | // buttons 2 | .btn { 3 | box-sizing: border-box; 4 | display: flex; 5 | flex-direction: row; 6 | justify-content: center; 7 | align-items: center; 8 | padding: var(--space-2) var(--space-3); 9 | border-radius: var(--border-radius); 10 | font-size: var(--size-s); 11 | outline: 0; 12 | background-color: transparent; 13 | border: 1px solid var(--primary-8); 14 | color: var(--primary-8); 15 | font-family: Inter; 16 | 17 | &:hover { 18 | cursor: pointer; 19 | background-color: var(--primary-2); 20 | // filter: brightness(85%); 21 | transition: all 200ms ease; 22 | } 23 | 24 | &.iconBtn { 25 | border: 0; 26 | padding: var(--space-2); 27 | border-radius: 50px; 28 | 29 | &:hover { 30 | background-color: var(--primary-4); 31 | } 32 | 33 | svg { 34 | height: 24px; 35 | width: 24px; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pgUI/components/Button/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | 3 | import styles from './Button.module.scss'; 4 | 5 | interface ButtonProps { 6 | children: React.ReactNode; 7 | onClick?(): any; 8 | } 9 | 10 | const Button: FC = ({ children, onClick }) => { 11 | return ( 12 | 15 | ); 16 | }; 17 | 18 | export default Button; 19 | -------------------------------------------------------------------------------- /pgUI/components/Card/Card.module.scss: -------------------------------------------------------------------------------- 1 | .card { 2 | position: relative; 3 | padding: var(--space-4); 4 | background-color: var(--primary-2); 5 | border: 1px solid var(--primary-4); 6 | border-radius: var(--border-radius); 7 | min-width: 10rem; 8 | transition: all 280ms ease; 9 | 10 | &:hover { 11 | cursor: pointer; 12 | border: 1px solid var(--primary-5); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pgUI/components/Card/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | 3 | import styles from './Card.module.scss'; 4 | 5 | interface CardProps { 6 | children: React.ReactNode; 7 | } 8 | 9 | const Card: FC = ({ children }) => { 10 | return
{children}
; 11 | }; 12 | 13 | export default Card; 14 | -------------------------------------------------------------------------------- /pgUI/components/Chip/Chip.module.scss: -------------------------------------------------------------------------------- 1 | .chip { 2 | display: flex; 3 | align-items: center; 4 | 5 | .colorSwatch { 6 | width: var(--space-2); 7 | height: var(--space-2); 8 | border-radius: 50%; 9 | margin-right: var(--space-1); 10 | } 11 | 12 | span { 13 | font-size: var(--size-xs); 14 | text-transform: uppercase; 15 | letter-spacing: 1px; 16 | color: var(--primary-7); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pgUI/components/Chip/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | 3 | import styles from './Chip.module.scss'; 4 | 5 | interface Props { 6 | label: string; 7 | // This could be improved with specific types but for now 8 | // they represent color vars 9 | type: 10 | | 'accent' 11 | | 'success' 12 | | 'error' 13 | | 'primary-5' 14 | | 'primary-9' 15 | | 'accent-darker'; 16 | } 17 | 18 | const Chip: FC = ({ label, type }) => { 19 | return ( 20 |
21 |
25 | {label} 26 |
27 | ); 28 | }; 29 | 30 | export default Chip; 31 | -------------------------------------------------------------------------------- /pgUI/components/Header/Header.module.scss: -------------------------------------------------------------------------------- 1 | .Header { 2 | width: 100%; 3 | height: 3.5rem; 4 | font-size: var(--size-s); 5 | padding: var(--space-3); 6 | background-color: var(--primary-8); 7 | color: var(--primary-3); 8 | 9 | h4 { 10 | font-weight: var(--normal-w); 11 | } 12 | 13 | nav { 14 | margin-right: var(--space-5); 15 | li { 16 | margin-left: var(--space-3); 17 | list-style: none; 18 | &:hover { 19 | color: var(--primary-2); 20 | } 21 | } 22 | } 23 | 24 | .logoGroup { 25 | margin-right: var(--space-5); 26 | h1 { 27 | // hide the coredb name 28 | display: none; 29 | visibility: hidden; 30 | font-size: var(--size-l); 31 | } 32 | } 33 | 34 | .UserTag { 35 | padding-left: var(--space-5); 36 | border-left: 1px solid var(--primary-6); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pgUI/components/Header/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | import cx from 'classnames'; 3 | import Link from 'next/link'; 4 | 5 | import Logo from '../Logo'; 6 | 7 | import styles from './Header.module.scss'; 8 | 9 | interface HeaderProps { 10 | userName: string; 11 | } 12 | 13 | const Header: FC = ({ userName }) => { 14 | return ( 15 |
16 | 17 | 18 | 19 |

CoreDB

20 | 21 |
22 |

Organization

23 |
24 | 37 |
38 |
39 | {userName} 40 |
41 |
42 |
43 | ); 44 | }; 45 | 46 | export default Header; 47 | -------------------------------------------------------------------------------- /pgUI/components/IconButton/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | import cx from 'classnames'; 3 | import iconList from '../../public/icons/iconList'; 4 | 5 | import styles from '../Button/Button.module.scss'; 6 | 7 | interface IconButtonProps { 8 | iconName: 9 | | 'activity' 10 | | 'codesandbox' 11 | | 'compass' 12 | | 'database' 13 | | 'server' 14 | | 'sliders' 15 | | 'terminal' 16 | | 'users'; 17 | onClick?(): any; 18 | } 19 | 20 | const IconButton: FC = ({ 21 | iconName = 'activity', 22 | onClick, 23 | }) => { 24 | const selectedIcon = iconList[iconName].src; 25 | return ( 26 | 30 | ); 31 | }; 32 | 33 | export default IconButton; 34 | -------------------------------------------------------------------------------- /pgUI/components/InstanceCard/InstanceCard.module.scss: -------------------------------------------------------------------------------- 1 | .cardTitle, 2 | .cardSubtitle { 3 | margin: var(--space-2) 0; 4 | } 5 | 6 | .cardTitle { 7 | color: var(--primary-8); 8 | margin-top: var(--space-3); 9 | } 10 | 11 | .cardSubtitle { 12 | margin-bottom: var(--space-3); 13 | color: var(--primary-6); 14 | font-size: var(--size-s); 15 | } 16 | 17 | .contextMenu { 18 | font-size: small; 19 | position: absolute; 20 | right: var(--space-2); 21 | top: var(--space-2); 22 | } 23 | 24 | .stats { 25 | padding: var(--space-3); 26 | border: 1px solid var(--primary-3); 27 | border-radius: var(--border-radius); 28 | justify-content: space-between; 29 | .stat { 30 | display: flex; 31 | flex-direction: column; 32 | margin: 0 var(--space-2); 33 | span:nth-of-type(odd) { 34 | font-size: var(--size-xs); 35 | color: var(--primary-6); 36 | margin-bottom: var(--space-1); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /pgUI/components/InstanceCard/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC, useMemo } from 'react'; 2 | import cx from 'classnames'; 3 | import { useRouter } from 'next/router'; 4 | import Link from 'next/link'; 5 | 6 | import Card from '../Card'; 7 | import Chip from '../Chip'; 8 | 9 | import styles from './InstanceCard.module.scss'; 10 | 11 | interface Props { 12 | dbName: string; 13 | id: string; 14 | paths: any; 15 | hasMenuOptions?: boolean; 16 | properties: { 17 | connection: string; 18 | cpu: number; 19 | dbname: string; 20 | environment: 'test' | 'dev' | 'prod'; 21 | extensions: Array; 22 | memory: string; 23 | size: number; 24 | status: 25 | | 'Submitted' 26 | | 'Provisioning' 27 | | 'Up' 28 | | 'Deleted' 29 | | 'Suspended' 30 | | 'Restarting'; 31 | }; 32 | } 33 | 34 | const InstanceCard: FC = ({ 35 | properties, 36 | id, 37 | dbName, 38 | paths, 39 | hasMenuOptions, 40 | }) => { 41 | const router = useRouter(); 42 | // Map status to colors for chip 43 | const statusColor = useMemo(() => { 44 | switch (properties?.status) { 45 | case 'Up': 46 | return 'success'; 47 | case 'Deleted': 48 | return 'error'; 49 | case 'Suspended': 50 | return 'primary-5'; 51 | case 'Submitted': 52 | return 'primary-9'; 53 | case 'Restarting': 54 | return 'accent'; 55 | case 'Provisioning': 56 | return 'accent-darker'; 57 | default: 58 | return 'accent'; 59 | } 60 | }, [properties?.status]); 61 | return ( 62 | 66 | href="/instances/1"> 67 | 68 | {hasMenuOptions && } 69 | 70 |

71 | {properties?.dbname} 72 |

73 |

74 | {properties.environment} 75 |

76 |
77 |
78 | Memory 79 | {properties.memory ?? 'N/A'} 80 |
81 |
82 | CPU 83 | {properties.cpu ?? 'NA'} 84 |
85 |
86 | Extensions 87 | {properties?.extensions?.length ?? 0} 88 |
89 | {/*
90 | Env 91 | {properties?.environment} 92 |
*/} 93 |
94 |
95 | 96 | ); 97 | }; 98 | 99 | export default InstanceCard; 100 | -------------------------------------------------------------------------------- /pgUI/components/InstanceNav/InstanceNav.module.scss: -------------------------------------------------------------------------------- 1 | .instanceNav { 2 | height: calc(100vh - 3.5rem); 3 | width: 3.5rem; 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: flex-start; 8 | background-color: var(--primary-3); 9 | padding-top: var(--space-3); 10 | border-right: 1px solid var(--primary-4); 11 | 12 | .link { 13 | margin: var(--space-2) 0; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pgUI/components/InstanceNav/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | import { useRouter } from 'next/router'; 3 | import Link from 'next/link'; 4 | 5 | import IconButton from '../IconButton'; 6 | import Tooltip from '../Tooltip'; 7 | 8 | import styles from './InstanceNav.module.scss'; 9 | import navOptions from './instanceNavData'; 10 | 11 | const InstanceNav: FC = () => { 12 | const router = useRouter(); 13 | console.log(router); 14 | return ( 15 |
16 | {navOptions.map((option) => ( 17 | 22 | 23 | 24 | 25 | 26 | ))} 27 |
28 | ); 29 | }; 30 | 31 | export default InstanceNav; 32 | -------------------------------------------------------------------------------- /pgUI/components/InstanceNav/instanceNavData.ts: -------------------------------------------------------------------------------- 1 | interface Option { 2 | label: string; 3 | link: string; 4 | iconName: 5 | | 'activity' 6 | | 'codesandbox' 7 | | 'compass' 8 | | 'database' 9 | | 'server' 10 | | 'sliders' 11 | | 'terminal' 12 | | 'users'; 13 | } 14 | 15 | const navOptions: Array
time value labels
2023-02-08 23:34:31.394+00 0 53 | 54 | ```json 55 | { 56 | "job": "metrics_exporter", 57 | "mode": "accessexclusivelock", 58 | "group": "postgres", 59 | "server": "arbitrary_postgres:5433", 60 | "datname": "postgres", 61 | "monitor": "pgDagger-prometheus", 62 | "__name__": "pg_locks_count", 63 | "instance": "metrics_exporter:9187" 64 | } 65 | ``` 66 | 67 |