Skip to content

Can someone explain what is happening here? #226

@Rc85

Description

@Rc85

https://github.com/margelo/react-native-nitro-sqlite?tab=readme-ov-file#batch-operation

const commands = [
  {query: 'CREATE TABLE TEST (id integer)'},
  {query: 'INSERT INTO TEST (id) VALUES (?)', params: [value1]},
  {query: 'INSERT INTO TEST (id) VALUES (?)', params: [value2]},
  {query: 'INSERT INTO TEST (id) VALUES (?)', params: [value3, value4, value5, value6]},
];

const res = NitroSQLite.executeSqlBatch('myDatabase', commands);

console.log(`Batch affected ${result.rowsAffected} rows`);

Specifically this.

{query: 'INSERT INTO TEST (id) VALUES (?)', params: [value3, value4, value5, value6]}

Is this inserting 4 rows at once? If so, how would it look with multiple columns?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions