Giter VIP home page Giter VIP logo

database_reorderer's Introduction

Database Reordererererer

Some people want order in their Databases.
Like, wanting the last 2 columns to be date_created and date_modified;
But after a while, business requirements and lazyness creep in, and the dreams fade. And they're stuck with an ugly unordered DB.

Come the DB Reorderer.

Clone it the repo.
Enter the directory
Start the server

git clone [email protected]:jardayn/database_reorderer.git  
cd database_reorderer  
php -S localhost:8000

Go to http://localhost:8000

Enter your DB info: Acc/Pass/Host/DbName

Enter the order of columns you want at the start and the end of your table.

Click Submit. You will get a list of tables in the DB.
If you don't want to reorder some tables - you can delete which one's you don't want reordered.

Then click submit again.
You'll get a list of queries that you need to run to satisfy your OCD

And now it's time for the quirks and features

Will it reorder tables that are already in order?

If everything is in order - it will ignore the table.
If you want id,first_name,last_name to be the first columns, and the first 2 columns of the table ar id,first_name - it will only move the last_name column. But, if the final columns are not in perfect order - it's gonna generate the query to adjust all of them.

What if a column in the order doesn't exist?

The DBRO will ignore columns that do not exist on a table. So if you have only id,last_name but not first_name - it will reorder the table to have id,last_name in the front. Same behavior for the end of the table.

I am doing this on a high bandwidth database, how do I avoid breaking everything with Read/Write locks?

Queries generated by the DBRO do not modify the DB, and I've added the "LOCK=NONE" to the queries, so you can avoid those pesky locks

Can it run queries on it's own?

Not now. But that's coming in the near future

Does it work with PostgreSQL?

Not yet. Maybe one day.

DBRO broke my production server, my company went bankrupt and my cat left me.

Whoops.

How do I get you to fix a bug/implement a new thing into DBRO?

Make an issue or PR. I'll see what can be done.

Why are you not copying the SCHEMA into another table, reordering it, and and then moving the data into the new reordered table?

It's a possibility, but that'll seriously screw with large tables. Cos it's gonna lock them up until the data is transferred from table A to table B. Will it be much faster? Yes. But I prefer not taking my DBs down.
But one day, I'll add this as an option.

Is this really the most useless FAQ?

Yes.

database_reorderer's People

Contributors

jardayn avatar

Stargazers

 avatar

Watchers

 avatar Daniël avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.