Skip to content

Convert easily SQL CREATETABLE queries to a valid JSON ready to import into PocketBase

Notifications You must be signed in to change notification settings

DaniBCD/SQLPocketBase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SQL to PocketBase Converter

A lightweight, premium-designed web tool to instantly convert PostgreSQL schema definitions (CREATE TABLE) into PocketBase JSON collections.

SQL to PocketBase Preview

πŸš€ Features

  • Instant Conversion: Parses SQL commands purely in the browser (client-side).
  • Smart Type Mapping:
    • VARCHAR/TEXT β†’ text
    • INT/SERIAL β†’ number (onlyInt: true)
    • BOOLEAN β†’ bool
    • JSONB β†’ json
    • TIMESTAMP β†’ date (or autodate for system fields)
  • Relation Detection: Automatically detects Foreign Keys (user_id β†’ relation to user_collection).
  • Premium UI: Modern dark mode aesthetic, glassmorphism, and responsive design.
  • Export Options: Copy directly to clipboard or download as .json.

πŸ› οΈ Usage

  1. Enter SQL: Paste your CREATE TABLE statements into the left panel.
  2. Convert: Click the "Convert Schema" button.
  3. Import: Download the JSON and import it directly into your PocketBase dashboard ("Settings" > "Import collections").

Example Input

CREATE TABLE posts (
    id UUID PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    content TEXT,
    is_published BOOLEAN DEFAULT false,
    author_id UUID, -- Auto-detected as relation to 'author_collection'
    created_at TIMESTAMP DEFAULT NOW()
);

πŸ’» Tech Stack

  • HTML5
  • Vanilla CSS3 (Custom variables, Flexbox/Grid, Animations)
  • Vanilla JavaScript (ES6+, Regex parsing)
  • Zero Dependencies

πŸ“„ License

MIT License. Feel free to use and modify for your own projects.

About

Convert easily SQL CREATETABLE queries to a valid JSON ready to import into PocketBase

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published