dbdaddy

module
v0.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: GPL-3.0

README

DBDaddy [draft]

A simple database management CLI tool.

safe for production use when version = v1.0.0

stable enough for development DB use, NOW.

Installation

not available on windows cuz fuck you, thats why. use wsl or something...

curl https://raw.githubusercontent.com/fossMeDaddy/dbdaddy/main/installer/install.sh | bash

Note from the author

Look prisma is a great tool from devex pov but applications dont run on developers, they run on a machine.

But I thought, well there has to be an alternative to it, you can't just recommend prisma to your CTO right!? how will you back your decision?

sorry but i am a fullstack (frontend) developer and i don't know how to write SQL & definitely don't wanna learn it anyway, so here's an automagic migrations gen tool & with it comes a bloated ORM architecture deal with it.

With this tool, I aim to give you an alternative to prisma minus the ORM (write your own fuckin SQL)

Just define a schema, this tool will handle migrations between schema changes.

Along with that, some other useful functionality like executing SQL, backup & restore, branches, etc.

supported databases:

  • Postgres (cuz' i fuckin love it)
  • MySQL (in progress, facing too many problems that shouldn't even have been there in pg... so that's gonna have to wait a little)
  • SQlite (haven't got a chance to touch it, but it won't take time I promise)

Features

Here are some features the CLI covers (for PG)

  • checking out to database branches, cloning & then checking out into database branches (kinda like git but way inferior)
  • inspecting database/table schema
  • deleting said databases
  • dumping databases
  • restoring databases from dump
  • executing raw SQL queries & exporting query
  • AND LASTLY, MY FAVOURITE, a custom diffing & migrations engine, to detect changes & generate necessary SQL for it

In Progress:

  • project structure & schema definition
  • hybrid migrations allowing you to interleave your own sql files in between autogenerated sql in case you are a competent developer & would like some control over your own database

Planned:

  • studio feature, obviously because no soydev with a $1000 clerk subscription would use a CLI for more than 10s
  • db visualize feature, have you seen dbdiagram.io? great website to visualize db connections, got the idea from them
  • testing suite, i haven't written any tests for this thing :p

Migrations [unstable]

it's actually simpler than most people would think... so simple in fact that I would NOT recommend it for production use (for now).

indexes, triggers & custom types are not supported.

constraints, columns, tables & views are diffed and tracked for changes but there is no modification support as of now for any of them, which means that, let's say if you make a field nullable in SQL, this tool will generate migrations to remove the column from your database & then re-create it with SQL column definition such that the field is now nullable. DATA WILL BE LOST.


DISCLAIMER: you might draw a conclusion that these docs are mean to read and a lot of leg-pulling going on, and you're not wrong! that's the whole satire :) the only thing factual here is this project's usage instructions & specs

nothing personal or hard feelings


Message to people who installed DBDaddy

okay first of all thank you! issues tab is always open for any bug encountered or contribution...

and second,

did you even read the fuckin source code?

it could've been a fuckin malware broooo wtf?!

Message to people who didn't install DBDaddy because they're smart & don't blindly download any binary available on internet

trust me bro, it's safe

your boy is barely capable of writing software that works let alone a freakin malware that steals your information

I AM A FUCKIN JAVASCRIPT DEV FOR GOD SAKES, just the idea of it makes me laugh hysterically.

Directories

Path Synopsis
cmd
build command
main command
release command
version command
db
db_int
this is a central place for calling driver-specific internal functions
this is a central place for calling driver-specific internal functions
pg
pg/pgq
not necessary to move ALL SQL queries here
not necessary to move ALL SQL queries here
lib
src-cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL