This gist summarises a way to simulate point-in-time recovery (PITR) using WAL-G. Most of the material is adapted from Creston's tutorial.
First we initialize a database cluster
pg_ctl init -D cluster
/* | |
* Copyright (C) 2023 Recompile.me. | |
* All rights reserved. | |
*/ | |
class TCP_Communicator: NSObject, StreamDelegate { | |
var readStream: Unmanaged<CFReadStream>? | |
var writeStream: Unmanaged<CFWriteStream>? | |
var inputStream: InputStream? |
// protoc ./*.proto --js_out=import_style=commonjs:./ --grpc-web_out=import_style=typescript,mode=grpcweb:./ | |
var pb = require('./grpc_pb'); | |
var svc = require('./grpc_grpc_pb'); | |
var grpc = require('@grpc/grpc-js'); | |
// 证书 | |
const tls = `-----BEGIN CERTIFICATE----- | |
-----END CERTIFICATE-----` |
protocol SocketDelegate: class { | |
/** | |
Called when `StreamDelegate` calls `stream(,eventCode)` with `.hasBytesAvailable` after all bytes have been read into a `Data` instance. | |
- Parameter result: `Data` result from InputStream. | |
*/ | |
func socketDataReceived(result: Data?) | |
/** | |
Called when `StreamDelegate` calls `stream(,eventCode)` with `.hasBytesAvailable` after all bytes have been read into a `Data` instance and it was nil. |
<!-- Goes into viewer.html just before ending </body> --> | |
<script> | |
let pinchZoomEnabled = false; | |
function enablePinchZoom(pdfViewer) { | |
let startX = 0, startY = 0; | |
let initialPinchDistance = 0; | |
let pinchScale = 1; | |
const viewer = document.getElementById("viewer"); | |
const container = document.getElementById("viewerContainer"); | |
const reset = () => { startX = startY = initialPinchDistance = 0; pinchScale = 1; }; |
This gist summarises a way to simulate point-in-time recovery (PITR) using WAL-G. Most of the material is adapted from Creston's tutorial.
First we initialize a database cluster
pg_ctl init -D cluster