Giter Club home page Giter Club logo

Comments (2)

thombashi avatar thombashi commented on May 28, 2024 1

@aborruso
I appreciate if you find it useful.

sqlitebiter using "-a" creates one db and 237 tables. Is it possible to append every source table to only one destination table (the structure is the same)?

I had added an experimental feature (--convert-config option) at sqlitebiter 0.26.0 to enables the above.
You could append every source table to only one destination table by the below command and the config file:

$ sqlitebiter -a --convert-config convert_config.json url https://si.siciliafse1420.it/elencobeneficiari?page=N

convert_config.json is as follows:

{
    "url" : [
        {
            "target_url": "https://si.siciliafse1420.it/elencobeneficiari?page=",
            "rules": {
                "P.IVA/CF" : {
                    "type hint": "text"
                }
            }
        }
    ]
}

I tested https://si.siciliafse1420.it/elencobeneficiari?page=1 to ...?page=10 can be converted to one destination table.

without the configuration file, sqlitebiter detects column data types from actual data and create(or append) a table.
If a detected table schema does not match with the existing table, sqlitebiter will create another table with a different table name even if -a option specified.

For example:
https://si.siciliafse1420.it/elencobeneficiari?page=1
https://si.siciliafse1420.it/elencobeneficiari?page=2
these pages detected different schema as follows.

page=1

Field Type Null Key Default Index Extra
Cod. interno INTEGER YES NULL
CIP TEXT YES NULL
Titolo TEXT YES NULL
CUP TEXT YES NULL
Soggetto TEXT YES NULL
P.IVA/CF TEXT YES NULL
Comune sede legale TEXT YES NULL
Indirizzo sede legale TEXT YES NULL
Importo finanziato TEXT YES NULL
Importo finanziato spesa pubblica TEXT YES NULL
Spese certificate TEXT YES NULL

page=2

Field Type Null Key Default Index Extra
Cod. interno INTEGER YES NULL
CIP TEXT YES NULL
Titolo TEXT YES NULL
CUP TEXT YES NULL
Soggetto TEXT YES NULL
P.IVA/CF INTEGER YES NULL
Comune sede legale TEXT YES NULL
Indirizzo sede legale TEXT YES NULL
Importo finanziato TEXT YES NULL
Importo finanziato spesa pubblica TEXT YES NULL
Spese certificate TEXT YES NULL

In this case, page=1 P.IVA/CF column type is TEXT (because include value other than numbers such as "-"), while page=2 P.IVA/CF column type is INTEGER. So, considered as different schema.

from sqlitebiter.

aborruso avatar aborruso commented on May 28, 2024

Hi @thombashi first of all thank you very much.

It works!!!

I'm opening a new related feature request

from sqlitebiter.

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.