SchemaJS
  • Getting Started
    • Preview
    • Setting up your environment
    • Hello World
  • Fundamentals
    • TypeScript Support
    • Module Imports
    • Custom Queries
    • Hooks
  • Reference Guides
    • SchemaJS Global
      • Table
      • Column
      • DataTypes
      • QueryBuilder
      • query
      • rawInsert
      • insert
      • print
    • Examples
Powered by GitBook
On this page
  1. Reference Guides
  2. SchemaJS Global

insert

PreviousrawInsertNextprint

Last updated 7 months ago

The insert method in SchemaJS is a higher-level API that provides a convenient way to insert data into a database and table using the context provided by globalThis.SJS_CONTEXT. It ensures that the correct database and table are referenced from the context, offering a more user-friendly and streamlined way of inserting data compared to the lower-level method. This method is designed to handle scenarios where the global context is already defined, making it easy to insert data without needing to explicitly specify the database or table every time.

function insert(row: any);
SchemaJS.insert({ id: "", book_name: "", ... })

rawInsert