The WeeWX database includes a "daily summary," which is a synopsis of data for a day. Things like the minimum value for the day, what time it occurred, etc. It's an optimization strategy. See the documentation *Daily summaries <http://www.weewx.com/docs/devnotes.htm#Daily_summaries>.*
So, if you did it your way, you would have to either maintain the daily summary for your new type yourself, or forgo the optimizations that it gets you. It's much easier to leverage the machinery that WeeWX already gives you. See this wiki article, *Strategies for getting data into weeWX <https://github.com/weewx/weewx/wiki/intake-strategies>*. As for the database, with V4.5 or later, it's super easy to add and subtract columns from the database. See the documentation for wee_database <http://www.weewx.com/docs/utilities.htm#wee_database_utility>, options --add-column <http://www.weewx.com/docs/utilities.htm#Action_--add-column> and --drop-columns <http://www.weewx.com/docs/utilities.htm#Action_--drop-columns>. -tk On Mon, Sep 11, 2023 at 10:57 AM DR <wxe...@gmail.com> wrote: > Thank you for not only the information, but the link to learn more. I > appreciate that. > > Since this group lives and breathes solutions, I'm curious as to the > comment that my approach (as you can tell, a very inexperienced programmer) > was the best way. > > The only other thought I would have would be to create my own little > SQLite data base (one filed other than the date and time) and have WeeWx > use that new database as a second source of information, rather than try to > just stuff one more new field in the schema. Does someone have a more > reasonable and sensible approach than what I suggested? Just a key word or > two for me to go looking would be helpful. Dale > > > On 9/11/2023 10:59 AM, Tom Keffer wrote: > > I'm not sure your approach is the best one, but to answer your questions: > > 1. Yes, WeeWX opens the database and leaves it open. > 2. Contention is managed by the SQLite database. See this documentation > <https://sqlite.org/lockingv3.html>. > 3. Unless an extension is acting otherwise, WeeWX does not write with > every LOOP packet. Only when archive records arrive. > > On Mon, Sep 11, 2023 at 8:10 AM DR <wxe...@gmail.com> wrote: > >> I'm just thinking about another project, and wonder how WeeWx uses the >> default database. >> >> >> When it is running does it open and leave open the database all the time? >> >> If so, is the database able to have another program add records to the >> database while WeeWx has it open? >> >> The reason I ask, is that I would like to have another program running >> which reads snow depth from a Campbell Scientific table, then add that >> value to the standard database at say 15 minute intervals with a field >> defined and added to the schema. >> >> In some days past, I know some databases would prevent more than one >> attempt to access it, even if not in the traditional deadly embrace >> situation. >> >> If WeeWx is busy stuffing new values in every 2 seconds during loop >> functions, can I also access it simultaneously as long as I don't try to >> touch the fields that WeeWx is writing to? >> >> >> Or is it necessary to shut down, briefly, access, then have the snow >> depth program open it, write the value, close it and then let WeeWx go >> merrily on it's way? >> >> I hope this question is within the scope of this user discussion. Dale >> >> >> -- >> 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+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/weewx-user/918b02a3-72d7-f7f7-2e77-a3a374489a85%40gmail.com >> . >> > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/CAPq0zEAjUcruwXiaeAkFhUY3mJEaFUbT%2Bh_SB8CL28xTyMFH%2BA%40mail.gmail.com > <https://groups.google.com/d/msgid/weewx-user/CAPq0zEAjUcruwXiaeAkFhUY3mJEaFUbT%2Bh_SB8CL28xTyMFH%2BA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/12538f08-287f-b3a5-3c8b-28c15486910c%40gmail.com > <https://groups.google.com/d/msgid/weewx-user/12538f08-287f-b3a5-3c8b-28c15486910c%40gmail.com?utm_medium=email&utm_source=footer> > . > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEA0WC%2B3e43G90mC9b3KRZUzWK7rkdp8_2Vk4E8%2Bv4Tr2Q%40mail.gmail.com.