1127

Vtl Data Generator is now available as a module

Showing 1 to 10 of 11 comments.

Comments for “Vtl Data Generator is now available as a module”
 

Posted by Dom on Friday 5th April 2024 at 08:39 GMT

Although by no means perfect I think the Data Generator is now sufficiently stable to be a module in its own right rather than just code that's available on Github.

It's a testament to the fact that Trongate is actually remarkably easy to use given that I didn't even know of its existence until early this year.

If you want to add fake data to your projects during development then this tool is for you. You can select which tables and then which columns you wish to populate with data and select how many rows you want to create. Realistically there is presently a limit of between three to five thousand rows of data that can be created at any one time. Logically you should be able to add millions but that requires some more robust code routines to make it bullet proof. I've also provided a few images that can be used as dummies for the purposes of fake rows. Nothing spectacular but all entirely free of copyright as they happen to feature one of my dogs.

It's pointless being able to add data if you can't then remove it at some point in the future so the Data Generator also provides the ability to remove data as well and as an added little bonus you can opt to reset the auto incrementor on the primary key as well (in point of fact it will currently reset all auto incremented columns).

Having done that it seemed only reasonable to provide a facility to add indexes to columns which can prove to be extremely beneficial when doing searches. Naturally if you can create indexes then you should be able to delete them so that feature too is available.

Lastly the is the option to create an export script so that you can transfer your database, with an option to script in the data therein as well.

This is presently at version 0.75 because I'm not 100% convinced that it's entirely free of faults and I also think that the looks of it could do with some improvement, particularly the rendering of tables. I'm relatively new to both php and css as languages so I've yet to figure out the nuances of how things can be and indeed should be done.

The module is free and the code is also available on github. I've included some help (all markdown based) and commented the code as best I can to ensure that you can see what's going on. I don't doubt that the php could be written better, chalk that one up to the fact that it's a new language to me, and equally I could almost certainly have written the Trongate stuff better. That's partly down to the fact that I honestly don't think that the documentation is anything like as beginner friendly as it either could or needs to be. I also think that the actual framework itself needs to be documented properly. I have actually made a start on that but it's one very obvious and missing part which if Trongate wants to have itself taken seriously ought to be addressed.

However the fact that I've managed to get as far as I have knowing sweet FA in the first place is a testament to how relatively easy it is to use.

Finally I should thank DaFa for answering several questions here and making some invaluable contributions on github. I'm extremely grateful.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by DaFa on Friday 5th April 2024 at 09:40 GMT

Well done Dom, I'll check out your improvements and do some more testing. If I find any bugs I'll let you know 👍
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by Dom on Friday 5th April 2024 at 09:52 GMT

Thanks Simon

I'm sure there are bugs, in fact I know there is one that randomly appears and then equally randomly doesn't but that's programming.

Dom
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by Dom on Friday 5th April 2024 at 19:22 GMT

I know that there was a bug with orphaned tables, ie tables with which no module is associated and hopefully that has now been caught and corrected. I have also tidied up the main routine that generates data.

Providing a precise maximum number of rows that can be created at any one time is proving difficult to pin down but the latest round of tests suggests that 5000 rows at a go should be pretty easy to do.

I have uploaded a new version with these changes and source code is also on github.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by Dom on Thursday 11th April 2024 at 12:22 GMT

Date and DateTime formatting should now be much easier and should, hopefully, remove the need to actively provide your own customisation for these data types.

The Is also 'seeded'' by default which can be of benefit to those users who also write tests because it ensures that the same fake data can be regenerated.

Internal help file has been updated to reflect the changes, as has the github repo, and of course the actual module download itself.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by Dom on Tuesday 16th April 2024 at 19:08 GMT

I have now added functionality that will transfer images (from a standard and thumbnail resources provided in the module) to the appropriate folders that get created by a single image uploader when added by the desktop app.

The internal help file has been amended accordingly.

At the point that you delete data those images that were copied and folders that were created will be deleted.

The fresh code is available on github. This is now a pretty comprehensive fake data generator and general database admin tool. Hope it proves useful.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by Dom on Wednesday 24th April 2024 at 15:14 GMT

Have just uploaded the latest version of this.

Image transfer now has a progress bar to track the progress of images being copied into the relevant image folders in a module's assets folder.

I discovered that there was a small bug that meant that if you were to create a module, then add a single picture uploader to it and then create fake data for it although images would be assigned to the correct field they would not be transferred. I had assumed that when you added a single Image uploader via the desktop app it automatically created the base pics and pics_thumbnails folders. As it happens it doesn't so the Data Generator will now do that automatically.

I have also correctly sized the sample thumbnail images.

All the code is in the github repo.

This comment was edited by Dom on Wednesday 24th April 2024 at 15:33 GMT

Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by Dom on Tuesday 30th April 2024 at 10:40 GMT

The latest version of this should now support your own system preference for either light or dark mode. It makes use of;

@media (prefers-color-scheme: dark)
@media (prefers-color-scheme: light)


The help has also been rewritten as I have finally figured out how to get Trongate assets references working in Markdown. It also has a new set of illustrations and they should also swap out depending on your own screen preferences for light of dark.

As before all of the code is on the github repo.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

Posted by DaFa on Thursday 2nd May 2024 at 07:03 GMT

Hi Dom,

While the system mode is nice, I'd prefer a light/dark button to toggle between modes on the page as I hate having to change the system mode each time 🙃

This comment was edited by DaFa on Thursday 2nd May 2024 at 07:03 GMT

Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by Dom on Friday 3rd May 2024 at 13:15 GMT

That's a fair point Simon.

My inherent laziness, coupled with a set of eyes that have definitely seen better times makes me tend to prefer dark mode , so my screen is set to that permanently and any app that automatically supports it ends up dark.

On the having to change display settings, did you know there is a little trick you can utilise in the dev tools?

In the dev tools click on the three horizontal dots in the dev tools menu and from the drop down select the 'Run Command' option.

At the command prompt type 'prefers' then select one of the emulate prefers-color-scheme options.

I will look into how one goes about having the best of both worlds when it comes to choosing display mode.
Level One Member

Dom

User Level: Level One Member

Date Joined: 12/01/2024

×