Forum Discussion
How to Save Custom Connector Credential/Connections into a Local Database(Read/Write) in PowerQuery
Hi everyone,
I’m developing a Power BI custom connector using Power Query SDK and I need to store the user’s connection configurations (Service URL, Username, Password, Connection Notes, etc.) inside a local database so that the connector can:
Read existing saved connections, and
Write new connections into the database.
So far, I can read data from the database using Odbc.Query, but I’m running into issues when trying to INSERT or UPDATE records. It seems that Power Query doesn’t execute non-SELECT statements normally through ODBC, especially with SQLite.
My questions:
What is the correct or recommended way to write to a local database from a custom connector?
Are there any built-in or default mechanisms in Power Query SDK for persisting user-created connections?
Has anyone successfully implemented read/write logic (INSERT/UPDATE/DELETE) inside a custom connector?
If so, could you please share a sample implementation?
I want to build behavior similar to “Add Connection” → save into DB → show in navigation list.
Any guidance, best practices, or example code would be greatly appreciated!
Thanks!
Hi manandhu
PQ can't INSERT/UPDATE/DELETE through a connector.
To read existign connections you can use Extension.CurrentCredential()
Handling authentication for Power Query connectors - Power Query | Microsoft Learn
In your connector you can use things like DataSource.Kind and DataSource.Path which are saved in the PBIX or Service.
Using a Data source path for Power Query connectors - Power Query | Microsoft Learn
Phil
3 Replies
- PhilipTreacySuper User
Hi manandhu
PQ can't INSERT/UPDATE/DELETE through a connector.
To read existign connections you can use Extension.CurrentCredential()
Handling authentication for Power Query connectors - Power Query | Microsoft Learn
In your connector you can use things like DataSource.Kind and DataSource.Path which are saved in the PBIX or Service.
Using a Data source path for Power Query connectors - Power Query | Microsoft Learn
Phil
- v-echaithraCommunity Support
Hi manandhu ,
Thank you PhilipTreacy for your inputs.Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.
Best regards,
Chaithra E. - v-echaithraCommunity Support
Hi manandhu ,
May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.
Thank you.