No rules about ordering. WeeWX reads the schema on startup, so it knows the
ordering of types.

An optional "daily summary" is also included in the database. Whether it is
included or not, or used or not, is dependent on the type of "database
manager" you use. This is specified by option
<https://github.com/weewx/weewx/blob/master/weewx.conf#L538> manager
<https://github.com/weewx/weewx/blob/master/weewx.conf#L538> in weewx.conf.
If it is weewx.manager.DaySummaryManager, then a daily summary is included.
If it is weewx.manager.Manager, then it is not.



On Mon, Aug 16, 2021 at 5:32 PM DR <[email protected]> wrote:

> Mr. Keffer:
>
> As far as defining additional items to put into the Sqlite database
> associated with WeeWx, other than the required items for WeeWx to work, is
> there an expected order in the data base columns, or may one insert a
> required column as needed, such as a new column for snow depth, or voltage
> gradient, right after what has already been defined, no particular order
> required?
>
> Sometimes there are rules from those who write and maintain the software
> like Sqlite, and then sometimes there are conventions used by those who
> modify or write new code for a program such as WeeWx.
>
> Again, curious, quite a way from doing any serious writing yet.
>
> Dale
>
>
> On 8/16/2021 5:55 PM, Tom Keffer wrote:
>
> Can't say that I've tried that, but I don't see why it wouldn't work. It's
> certainly simpler.
>
> Let me know how it goes.
>
> On Mon, Aug 16, 2021 at 9:11 AM [email protected] <[email protected]>
> wrote:
>
>> Thanks Tom.
>>
>> I have another question before proceeding.  Do I need to physically
>> update the schema to include column and type or could I just use the
>> following command:
>>
>> wee_database --add-column=comments --type=TEXT
>>
>> Rich
>>
>> On Monday, August 16, 2021 at 8:29:16 AM UTC-4 [email protected] wrote:
>>
>>> Good question. Yes, it is possible to store text.
>>>
>>> 1. Assuming you're using sqlite, make sure you read their documentation
>>> on data types: https://sqlite.org/datatype3.html
>>>
>>> 2. Create a new schema accordingly. For example,
>>>
>>> table = [('dateTime', 'INTEGER NOT NULL UNIQUE PRIMARY KEY'),
>>>          ('usUnits', 'INTEGER NOT NULL'),
>>>          ('interval', 'INTEGER NOT NULL'),
>>>          ('outTemp',  'REAL'),
>>>          ('comments', 'TEXT')
>>>          ]
>>>
>>>
>>> day_summaries = [('outTemp', 'scalar'), ('comments', 'scalar')]
>>>
>>> schema = {
>>>     'table': table,
>>>     'day_summaries' : day_summaries
>>> }
>>>
>>>
>>> This is just an example. Your schema is likely to have many more types
>>> than this.
>>>
>>> 3. See the directions in the Customizing Guide for how to specify that
>>> your new schema be used. *Picking a starting schema
>>> <http://www.weewx.com/docs/customizing.htm#Picking_a_starting_schema>*.
>>>
>>> 4. Read the developer's notes on Accumulators
>>> <https://github.com/weewx/weewx/wiki/Accumulators>. In your weewx.conf
>>> file, specify that your text type should be accumulated using the "
>>> firstlast" accumulator. This will prevent it from trying to find the
>>> average, etc, of a string.
>>>
>>> [Accumulator]
>>>     [[comments]]
>>>         accumulator = firstlast
>>>
>>>
>>> That's it. If your new type appears in the archive record, then it will
>>> be included in the database.
>>>
>>> Tags like
>>>
>>> <p>Details: $current.comments, last recorded at $day.comments.last</p>
>>>
>>>
>>> should also work.
>>>
>>>
>>> On Sun, Aug 15, 2021 at 8:43 PM [email protected] <[email protected]>
>>> wrote:
>>>
>>>> In the Weewx DB, the column data types are  primary Real or Integer but
>>>> is it possible to store data as Text?
>>>
>>> --
>>>> 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 [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/weewx-user/faf66dd7-7e4a-45fa-9737-6f0094024c88n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/weewx-user/faf66dd7-7e4a-45fa-9737-6f0094024c88n%40googlegroups.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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/c4c792b5-c214-446e-9e4b-6d76dbc14aabn%40googlegroups.com
>> <https://groups.google.com/d/msgid/weewx-user/c4c792b5-c214-446e-9e4b-6d76dbc14aabn%40googlegroups.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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAPq0zEA%3D%2Bkt_kQw0QUpCVCcu85LfsJbqsD%3Dc4bsQ0_PSeU0DtA%40mail.gmail.com
> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEA%3D%2Bkt_kQw0QUpCVCcu85LfsJbqsD%3Dc4bsQ0_PSeU0DtA%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEC-5Om%2BMngq2Do5Wp5v1wJBPvFoN%2BaZRCxANdutCEfoAg%40mail.gmail.com.

Reply via email to