Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

into sqlite for conversions

Convert table into a SQLite database.

Signature

> into sqlite {flags} (file-name)

Flags

  • --table-name, -t {string}: Specify table name to store the data in

Parameters

  • file-name: Specify the filename to save the database to.

Input/output types:

inputoutput
tablenothing
recordnothing

Examples

Convert ls entries into a SQLite database with 'main' as the table name

> ls | into sqlite my_ls.db

Convert ls entries into a SQLite database with 'my_table' as the table name

> ls | into sqlite my_ls.db -t my_table

Convert table literal into a SQLite database with 'main' as the table name

> [[name]; [-----] [someone] [=====] [somename] ['(((((']] | into sqlite filename.db

Insert a single record into a SQLite database

> { foo: bar, baz: quux } | into sqlite filename.db

Insert data that contains records, lists or tables, that will be stored as JSONB columns These columns will be automatically turned back into nu objects when read directly via cell-path

> {a_record: {foo: bar, baz: quux}, a_list: [1 2 3], a_table: [[a b]; [0 1] [2 3]]} | into sqlite filename.db -t my_table
(open filename.db).my_table.0.a_list
╭───┬───╮
│ 0 │ 1 │
│ 1 │ 2 │
│ 2 │ 3 │
╰───┴───╯