Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@electric-sql/pglite-repl
Advanced tools
A REPL, or terminal, for use in the browser with PGlite, allowing you to have an interactive session with your WASM Postgres in the page.
A REPL, or terminal, for use in the browser with PGlite, allowing you to have an interactive session with your WASM Postgres in the page.
\d
PSQL commands (via psql-describe)npm install @electric-sql/pglite-repl
then to include in a page:
import { PGlite } from "@electric-sql/pglite";
import { Repl } from "@electric-sql/pglite-repl";
function MyComponent() {
const pg = new PGlite();
return <>
<Repl pg={pg} />
</>
}
The props for the <Repl>
component are described by this interface:
// The theme to use, auto is auto switching based on the system
type ReplTheme = "light" | "dark" | "auto";
interface ReplProps {
pg: PGlite; // PGlite db instance
border?: boolean; // Outer border on the component, defaults to false
lightTheme?: Extension;
darkTheme?: Extension;
theme?: ReplTheme; // Defaults to "auto"
}
The lightTheme
and darkTheme
should be instances of a React CodeMirror theme.
Although the PGlite REPL is built with React, its also available as a web component for easy inclusion in any page or other framework.
<script src="https://cdn.jsdelivr.net/npm/@electric-sql/pglite/dist-webcomponent/Repl.js" type="module"></script>
<!-- Include the Repl web component in your page -->
<pglite-repl id="repl"></pglite-repl>
<script type="module">
import { PGlite } from "https://cdn.jsdelivr.net/npm/@electric-sql/pglite/dist/index.js";
// Create a PGlite instance
const pg = new PGlite();
// Retrieve the Repl element
const repl = document.getElementById('repl');
// REPL to your PGlite instance
repl.pg = pg;
</script>
Checkout this repo and from package dir:
# Install deps
pnpm install
# Run dev server
pnpm dev
# then open a browser to the url shown
# Build the lib
pnpm build
FAQs
A REPL, or terminal, for use in the browser with PGlite, allowing you to have an interactive session with your WASM Postgres in the page.
The npm package @electric-sql/pglite-repl receives a total of 70 weekly downloads. As such, @electric-sql/pglite-repl popularity was classified as not popular.
We found that @electric-sql/pglite-repl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.