Giter Site home page Giter Site logo

Comments (2)

joyant avatar joyant commented on May 24, 2024

What about:

INSERT INTO
    tb_name
        [TAGS (tag1_value, ...)]
        [(field1_name, ...)]
        VALUES (field1_value, ...) [(field1_value2, ...) ...]
  1. Insert one record with function now(), the timestamp is always in the first position.
INSERT INTO d1001 tags("sh", "1.1.1.1") VALUES (now(), 10.2, 219, 0.32);
  1. Insert multiple records with time, I think adding comma is better.
INSERT INTO d1001 VALUES
('2021-07-13 14:06:32.272', 10.2, 219, 0.32), 
(1626164208000, 10.15, 217, 0.33),
(now()-1s, 1, 2, 3);
  1. Specify column names when inserting data.
-- ts or timestamp ?
INSERT INTO d1001 (ts, current, phase) VALUES (now(), 10.27, 0.31);
  1. Allow table creation during insertion ?

ref tdengine

from lindb.

stone1100 avatar stone1100 commented on May 24, 2024

I think it is difficult to define the type of fields in insert statement. So not allow table creation during insertion.

Steps:

  1. create table(#1010 )
create table if not exist cpu 
(
    host tag,
    ip tag,
    load last,
    temperature max
);
  1. insert data
-- single
INSERT INTO cpu (timestamp, host, ip, load) VALUES (now(), "sh","1.1.1.1",4);
-- batch
INSERT INTO cpu (timestamp, host, ip, load) 
VALUES 
(now(), "sh","1.1.1.1",4),
(now(), "sh","1.1.1.2",5),
(now(), "sh","1.1.1.3",4),
;

also depend(#1015 )

from lindb.

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.