WireBootstrap
HomeDocsBuySupport
  • Introduction
  • Overview
  • Getting Started
  • Installation
  • Connecting to Data
    • Data Connectors
      • SQL Data
      • Custom Web Services
      • Local Data
      • Other Sources
    • Data Sources
    • Discovery
    • Building a Data Connector
  • Working With Queries
    • Select Queries
      • Query Extensions
    • Stored Procedures
    • Custom Web Services
    • Executing Queries
    • ORM
  • Writing Data
  • Updates
  • Deletes
  • Working with DataTables
    • Introduction
    • Filter and Sort
    • Select and Calculate
    • Joins
    • Rows
    • Columns
  • Working with DataSets
  • Introduction
  • Executing Queries
  • Transforms
  • Writing Data
  • Data Events
  • Working with Components
    • Introduction
    • Encapsulation
    • Configuration
      • Data
      • Events
      • Observables
      • Validation
      • Display
      • Vendor
      • Custom
    • Component
    • Web Frameworks
    • Building a Component
      • Hello World
      • Data Events
      • DataSets
  • Working With Data Events
    • Introduction
    • Event Basics
    • Event Data
    • Event Actions
  • Working with Themes
    • Introduction
    • Sample Data
    • Libraries
    • Pages
    • Building a Theme Project
  • Utilities
    • Formatting
    • Expressions
    • Collections
    • Spinners
    • Copy and Merge
    • Validation
    • Loading Assets
    • Service Calls
    • Download Files
    • Browser Location
    • Types
    • Promise
  • Reference
    • wire
      • wire.Collection
      • wire.download
      • wire.validate
    • wire.data
      • wire.data.DataEvent
      • wire.data.DataModel
      • wire.data.DataPromise
      • wire.data.DataSet
      • wire.data.DataSource
      • wire.data.DataTable
        • Columns
        • Rows
      • wire.data.StoredProcedure
      • wire.data.TableQuery
    • wire.ui
      • wire.ui.Component
      • wire.ui.validate
Powered by GitBook
On this page

Was this helpful?

Updates

PreviousORMNextDeletes

Last updated 3 years ago

Was this helpful?

To write data back to a data service using a data source object, use the write method on the data source.

To check for service provider support for writing data, use the allow.write attribute on the object servicing the query request. Visit the data source service provider documentation for details on support for writing data.

Writing Data

The following sends two users to the data service to be persisted in the Users table in a relational database using the as identified by the table parameter in the data source constructor. An option specifies the key on the entity. Options are provider specific. This option is used by the query service to determine whether to insert or update each record.

const accountService = new wire.data.DataSource("sql", {
    Provider: {
        Server: "query-server"
    }
});

const users = [
    {UserName: "jkratz", Active: true},
    {UserName: "pdougherty", Active: false},
]
 
const options = {
    Keys: ["name"]
}

const newrows = accountService.write("Users", users, options);

Visit for more on the query service.

DataSource
WireBootstrap Query Service
WireBootstrap Query Service