Multiple Data Bindings

50 views
Skip to first unread message

Wout Vdh

unread,
Oct 1, 2019, 5:35:33 PM10/1/19
to weewx-user
Hi

Is it possible to have multiple data_bindings to archive data in SQLite and MySQL at the same time?
I can't define the parameter twice and I can't use a list (data_binding = wx_binding, mysql_binding).

Best regards
Wout

Thomas Keffer

unread,
Oct 1, 2019, 7:09:19 PM10/1/19
to weewx-user
Yes, you can do this. In fact, there's an example in the Customization Guide of using MySQL and SQLite simultaneously. See the section Using multiple bindings.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/890eeb53-2201-47bb-89ac-169bb56bf92e%40googlegroups.com.

gjr80

unread,
Oct 1, 2019, 9:04:54 PM10/1/19
to weewx-user
Maybe it's just my brain, but when I first read the OP I thought the question was along the lines of dual storing of archive data rather than reporting/plotting from multiple archives. Might be handy if the OP clarified.

Gary 

On Wednesday, 2 October 2019 09:09:19 UTC+10, Thomas Keffer wrote:
Yes, you can do this. In fact, there's an example in the Customization Guide of using MySQL and SQLite simultaneously. See the section Using multiple bindings.

On Tue, Oct 1, 2019 at 2:35 PM Wout Vdh <wout...@gmail.com> wrote:
Hi

Is it possible to have multiple data_bindings to archive data in SQLite and MySQL at the same time?
I can't define the parameter twice and I can't use a list (data_binding = wx_binding, mysql_binding).

Best regards
Wout

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

Wout Vdh

unread,
Oct 2, 2019, 6:26:17 AM10/2/19
to weewx-user
Thank you for your feedback.
Gary's brain is right! ;-) I'd like to store the data into 2 different databases (1 SQLite and one MySQL) and not use 2 different databindings in my reports.
Is there a way to do this?

Many thanks
Wout

Thomas Keffer

unread,
Oct 2, 2019, 7:36:23 AM10/2/19
to weewx-user
That's not the first time Gary's brain has been right, and mine has not been.

There is no "out of the box" way to do that, but you could write a service, bind it to NEW_ARCHIVE_RECORD events, then have it write to the 2nd database.

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/f425cba5-8560-4f2b-a306-197a1a4f1fa9%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages