At this time i am on testing something inside a database. It is a wordpress database. i must write and remove and do other operation onto it. You may already know it, it's indexing mechanism that can certainly make every new publish inherit the following greatest possible ID.
Please take into account that this database is really a copying of used database. it's been written before. So, i will have to make certain after i finish my testing, it will likely be exactly the same
At this time, my only option would be making backup. Therefore if i've finish in certain portion of planned testing, i'll backup it and begin next testing on another copy from it.
Fortunately, how big database is just a small one. so remove and copy and backup it will likely be easy. however i know by doing this of database tests are only partial solution.It pressure me to produce a lot of backup copy. I'm not sure things i is going to do when the database has bigger size. it will likely be a really lengthy of testing nightmare.
and so i question can there be any solution that actually work much like rollback. Therefore it will just lock the database and merely put new entry as some type of cache. I'm able to erase it or write it in to the database.
i personally use mysql and phpmyadmin and employ it to developed some custom solution.
EDIT ::: How you can effectively doing testing on database when developing PHP solution ?
Once you remove the record, whenever you place the brand new record, should you set the id to the quantity you want, instead of departing it blank, it will just fill that index again.
In case your file system supports writeable pictures - LVM, ZFS, Veritas, etc. - you are able to take an immediate copy from the entire database partition, mount that in another place, begin a new demonstration of MYSQL which utilizes the snapshot, perform your testing, remove your snapshot - all without disturbing your replica.
The snapshot only needs storage for the quantity of data that will get transformed throughout your testing, and thus might just have a couple of GB.
May be the publish number an autoincrement area? Otherwise, hack into WordPress (temporarily) and search for the code in which the new posts are saved. Before saving why not give a constant e.g. 1000 to publish id number. When you're carried out with your testing simply remove the id amounts which are more than your constant.