clear custom databases

Stimulsoft Reports.JS discussion
Post Reply
fridaystreet
Posts: 20
Joined: Thu Jun 08, 2023 11:40 pm

clear custom databases

Post by fridaystreet »

we are using the following command in a react component to add a custom database type to the editor on load

Code: Select all

window.Stimulsoft.Report.Dictionary.StiCustomDatabase.registerCustomDatabase(options)
Is there a way to clear the existing registrations or check if the custom db is already registered before running this command? Currently each time the component renders it adds another instance of the custom db and the list of databases in the UI just keeps growing.

I realise we could try and manage this with some state, but that still isn't ideal as it might be out of sync. It would be better if we could just reset the list before registering or query the editor in some way to check if it is registered

Cheers
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: clear custom databases

Post by Lech Kulikowski »

Hello,

It is stored in the browser cache, you can clear it.

Thank you.
fridaystreet
Posts: 20
Joined: Thu Jun 08, 2023 11:40 pm

Re: clear custom databases

Post by fridaystreet »

any idea how?

or do you mean clear the entire browser cache? that can't be right surely. we'd be having to get the user to refresh the page every 30 seconds
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: clear custom databases

Post by Lech Kulikowski »

Hello,

You can use the following code to check and remove unnecessary adapters:

Code: Select all

for (var i = 0; i < StiOptions.Services.databases.length; i++) {
                if (StiOptions.Services.databases[i].serviceName == "PostgreSQL" || StiOptions.Services.databases[i].serviceName == "Firebird")  // .....
                    StiOptions.Services.databases.splice(i, 1);
            }
Thank you.
fridaystreet
Posts: 20
Joined: Thu Jun 08, 2023 11:40 pm

Re: clear custom databases

Post by fridaystreet »

Great thanks appreciate your help
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: clear custom databases

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply