Databehandling i kommandoraden
Susan Sun
Data Person
csvsql:
Fler alternativ:
--insert--db--no-inference & --no-constraintsExempelsyntax:
csvsql --db "sqlite:///SpotifyDatabase.db" \
--insert Spotify_MusicAttributes.csv
Obs:
Radbrytning används för att hålla koden ren och läsbar
Använd tre snedstreck för att inleda databasnamnet
Avsluta med filändelsen .db för en SQLite-databas
Exempelsyntax:
csvsql --db "sqlite:///SpotifyDatabase.db" \
--insert Spotify_MusicAttributes.csv
Dokumentation:
csvsql -h
--insert In addition to creating the table, also insert the
data into the table. Only valid when --db is specified.
Exempelsyntax:
csvsql --no-inference --no-constraints \
--db "sqlite:///SpotifyDatabase.db" \
--insert Spotify_MusicAttributes.csv
Dokumentation:
csvsql -h
--no-inference Disable type inference when parsing the input.
--no-constraints Generate a schema without length limits or null checks.
Databehandling i kommandoraden