Code Monkey home page Code Monkey logo

Comments (3)

matthewwall avatar matthewwall commented on July 20, 2024

using [SQLite] and [MySQL] stanzas has a well-defined upgrade path; we can automatically convert existing weewx.conf files.

so the default weewx.conf would look like this:

[Databases]
    [[archive_sqlite]]
        database_name = weewx.sdb
        driver = weedb.sqlite
    [[archive_mysql]]
        database_name = weewx
        driver = weedb.mysql

and a user could override the sqlite database location for a single database like this:

[Database]
    [[custom_sqlite]]
        database_name = /home/username/custom.sdb
        driver = weedb.sqlite

or like this:

[Database]
    [[custom_sqlite]]
        SQLITE_ROOT = /home/username
        database_name = custom.sdb
        driver = weedb.sqlite

or override mysql login credentials like this (still using the same 'localhost' defined in the [MySQL] stanza):

[Database]
    [[custom_mysql]]
        database_name = custom
        user = username
        password = pw
        driver = weedb.mysql

so the minimal definition for an extension (specified in install.py) would be this:

[Databases]
  [[cmon_sqlite]]
    database_name = cmon.sdb
    driver = weedb.sqlite
  [[cmon_mysql]]
    database_name = cmon
    driver = weedb.mysql

from weewx.

tkeffer avatar tkeffer commented on July 20, 2024

Exactly.

One correction: on my earlier post, I proposed including the driver in the [SQLite] and [MySQL] stanzas. That won't work because, right now, the driver name is the only way to identify what kind of database it is.

We can either do things the way you outline above, or introduce yet another level of indirection:

[Databases]
  [[cmon_sqlite]]
    database_name = cmon.sdb
    database_type = SQLite
  [[cmon_mysql]]
    database_name = cmon
    database_type = MySQL

where option database_type has to match a stanza name.

from weewx.

tkeffer avatar tkeffer commented on July 20, 2024

Fixed in V3.2. With the addition of [SQLite] and [MySQL], the installer has become much simpler.

Closing issue.

from weewx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.