I was going to add just one field to the database, I would repurpose an
existing field that is unused but has a similar unit. If you're going do
more than 5 fields, then doing your own db may be the better way. If you're
writing a single value every 15 min, I wouldn't worry about
performance/locking issues.

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>
> .
>


-- 
Peter Quinn
(415)794-2264

-- 
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/CAA1SM21fe3ruZaeaE9RW81Bz5rcXB8qKzA_KQX8QzRuQcpRPCw%40mail.gmail.com.

Reply via email to