Shopify Query Data Model

Connection String Options

  1. App Id
  2. Auto Cache
  3. Batch Size
  4. Cache Connection
  5. Cache Driver
  6. Cache Location
  7. Cache Metadata
  8. Cache Query Result
  9. Connection Life Time
  10. Connect On Open
  11. Firewall Password
  12. Firewall Port
  13. Firewall Server
  14. Firewall Type
  15. Firewall User
  16. Location
  17. Logfile
  18. Max Log File Size
  19. Offline
  20. Other
  21. Password
  22. Pool Idle Timeout
  23. Pool Max Size
  24. Pool Min Size
  25. Pool Wait Time
  26. Proxy Auth Scheme
  27. Proxy Auto Detect
  28. Proxy Exceptions
  29. Proxy Password
  30. Proxy Port
  31. Proxy Server
  32. Proxy SSL Type
  33. Proxy User
  34. Pseudo Columns
  35. RTK
  36. Shop Url
  37. SSL Server Cert
  38. Support Enhanced SQL
  39. Tables
  40. Timeout
  41. Use Connection Pooling
  42. Verbosity
  43. Views

App Id

Data Type

string

Default Value

""

Remarks

AppId for the admin API.

 

Auto Cache

Data Type

bool

Default Value

false

Remarks

When AutoCache is set, the driver automatically maintains a cache of your table's data in the database of your choice. With CacheQueryResult additionally set, the driver updates the cache when you execute a SELECT query and returns the live results from the Shopify data.

 

Explicitly Caching SELECT Results

 

CacheQueryResult is a way to query Shopify in real time while maintaining a cache for offline use. Set CacheQueryResult to update the cache whenever you execute a SELECT statement. When you execute a SELECT statement with AutoCache and CacheQueryResult set, the driver executes the query to the remote data and caches the results; rows that already exist are overwritten. That is, SELECT statements are used to create and refresh the cache, not to query it. Data manipulation commands are executed to the remote data as well.

To query the cached data, set the Offline property. If you need to query the cached data in an online connection, you can append #CACHE to the table name. For example:

SELECT * FROM [Customers#CACHE]

 

 

Setting the Caching Database

 

When AutoCache is set, the driver caches to a simple, file-based cache. You can configure its location or cache to a different database with the following properties:

 

 

See Also

 

 

  • CacheQueryResult: Insert or update each row returned into the corresponding table in the cache.
  • Caching: Best Practices: This section provides more examples of using AutoCache with Offline, as well as information on determining a caching strategy.
  • CacheMetadata: This property reduces the amount of metadata that crosses the network by persisting table schemas retrieved from the Shopify metadata. Metadata then needs to be retrieved only once instead of every connection.
  • CACHE Statements: You can use the CACHE statement to persist any SELECT query, as well as manage the cache; for example, refreshing schemas.

 

 

 

Batch Size

Data Type

int

Default Value

0

Remarks

When BatchSize is set to a value greater than 0, the batch operation will split the entire batch into separate batches of size BatchSize. The split batches will then be submitted to the server individually. This is useful when the server has limitations on the size of the request that can be submitted.

Setting BatchSize to 0 will submit the entire batch as specified.

 

Cache Connection

Data Type

string

Default Value

""

Remarks

 

The cache database is determined based on the CacheDriver and CacheConnection properties. Both properies are required to use the cache database. Examples of common cache database settings can be found below. For more information on setting the caching database's driver, refer to CacheDriver.

The connection string specified in the CacheConnection property is passed directly to the underlying CacheDriver. Consult the documentation for the specific JDBC driver for more information on the available properties. Make sure to include the JDBC driver in your application's classpath.

 

Derby and Java DB

 

The driver simplifies caching to Derby, only requiring you to set the CacheLocation property to make a basic connection.

Alternatively, you can configure the connection to Derby manually using CacheProvider and CacheConnection. Below is the Derby JDBC URL syntax:

jdbc:derby:[subsubprotocol:][databaseName][;attribute=value[;attribute=value] ... ]
For example, to cache to an in-memory database, use the following:
jdbc:derby:memory

 

 

SQLite

 

To cache to SQLite, you can use the SQLite JDBC driver. Below is the syntax of the JDBC URL:

jdbc:sqlite:dataSource
  • Data Source: The path to an SQLite database file. Or, use a value of :memory to cache in memory.

 

 

MySQL

 

The installation includes the CData JDBC Driver for MySQL. Below is an example JDBC URL:

jdbc:mysql:User=root;Password=root;Server=localhost;Port=3306;Database=cache
Below are typical connection properties:

 

 

  • Server: The IP address or domain name of the server you want to connect to.
  • Port: The port that the server is running on.
  • User: The username provided for authentication to the database.
  • Password: The password provided for authentication to the database.
  • Database: The name of the database.
SQL Server

 

The JDBC URL for the Microsoft JDBC Driver for SQL Server has the following syntax:

jdbc:sqlserver://[serverName[\instance][:port]][;database=databaseName][;property=value[;property=value] ... ]
For example:
jdbc:sqlserver://localhost\sqlexpress:1433;integratedSecurity=true
Below are typical SQL Server connection properties:
  • Server: The name or network address of the computer running SQL Server. To connect to a named instance instead of the default instance, this property can be used to specify the host name and the instance, separated by a backslash.
  • Port: The port SQL Server is running on.
  • Database: The name of the SQL Server database.
  • Integrated Security: Set this option to true to use the current Windows account for authentication. Set this option to false if you are setting the User and Password in the connection.

    To use integrated security, you will also need to add sqljdbc_auth.dll to a folder on the Windows system path. This file is located in the auth subfolder of the Microsoft JDBC Driver for SQL Server installation. The bitness of the assembly must match the bitness of your JVM.

  • User ID: The username provided for authentication with SQL Server. Only needed if you are not using integrated security.
  • Password: The password provided for authentication with SQL Server. Only needed if you are not using integrated security.
Oracle

 

Below is the conventional JDBC URL syntax for the Oracle JDBC Thin driver:

jdbc:oracle:thin:[userId/password]@[//]host[[:port][:sid]]
For example:
jdbc:oracle:thin:scott/tiger@myhost:1521:orcl
Below are typical connection properties:
  • Data Source: The connect descriptor that identifies the Oracle database. This can be a TNS connect descriptor, an Oracle Net Services name that resolves to a connect descriptor, or, after version 11g, an Easy Connect naming (the host name of the Oracle server with an optional port and service name).

  • Password: The password provided for authentication with the Oracle database.
  • User Id: The user Id provided for authentication with the Oracle database.
PostgreSQL

 

Below is the JDBC URL syntax for the official PostgreSQL JDBC driver:

jdbc:postgresql:[//[host[:port]]/]database[[?option=value][[&option=value][&option=value] ... ]]
For example, the following connection string connects to a database on the default host (localhost) and port (5432):
jdbc:postgresql:postgres
Below are typical connection properties:
  • Host: The address of the server hosting the PostgreSQL database.
  • Port: The port used to connect to the server hosting the PostgreSQL database.
  • Database: The name of the database.
  • Username: The user Id provided for authentication with the PostgreSQL database. You can specify this in the JDBC URL with the "user" parameter.
  • Password: The password provided for authentication with the PostgreSQL database.

 

 

Cache Driver

Data Type

string

Default Value

""

Remarks

 

You can cache to any database for which you have a JDBC driver, including CData JDBC drivers.

The cache database is determined based on the CacheDriver and CacheConnection properties. The CacheDriver is the name of the JDBC driver class that you would like to use to cache data.

Note that you must also add the CacheDriver JAR to the classpath.

The following examples show how to cache to several major databases. Refer to CacheConnection for more information on the JDBC URL syntax and typical connection properties.

Derby and Java DB

 

 

The driver simplifies Derby configuration. Java DB is the Oracle distribution of Derby. The JAR is shipped in the JDK. You can find the JAR, derby.jar, in the db subfolder of the JDK installation. In most caching scenarios, you need to specify only the following, after adding derby.jar to the classpath.

jdbc:shopify:CacheLocation='c:/Temp/cachedir';AppId=MyAppId;Password=MyPassword;ShopUrl=https://yourshopname.myshopify.com;
To customize the Derby JDBC URL, use CacheDriver and CacheConnection. For example, to cache to an in-memory database, use a JDBC URL like the following:
jdbc:shopify:CacheDriver=org.apache.derby.jdbc.EmbeddedDriver;CacheConnection='jdbc:derby:memory';AppId=MyAppId;Password=MyPassword;ShopUrl=https://yourshopname.myshopify.com;
SQLite

 

Below is a JDBC URL for the SQLite JDBC driver:

jdbc:shopify:CacheDriver=org.sqlite.JDBC;CacheConnection='jdbc:sqlite:C:/Temp/sqlite.db';AppId=MyAppId;Password=MyPassword;ShopUrl=https://yourshopname.myshopify.com;
MySQL

 

Below is a JDBC URL for the included CData JDBC Driver for MySQL:

  jdbc:shopify:Cache Driver=cdata.jdbc.mysql.MySQLDriver;Cache Connection='jdbc:mysql:Server=localhost;Port=3306;Database=cache;User=root;Password=123456';AppId=MyAppId;Password=MyPassword;ShopUrl=https://yourshopname.myshopify.com;

  
The CData JDBC Driver for MySQL is located in the lib subfolder of the CData JDBC Driver for Shopify 2018 installation directory.
SQL Server

 

The following JDBC URL uses the Microsoft JDBC Driver for SQL Server:

jdbc:shopify:Cache Driver=com.microsoft.sqlserver.jdbc.SQLServerDriver;Cache Connection='jdbc:sqlserver://localhost\sqlexpress:7437;user=sa;password=123456;databaseName=Cache';AppId=MyAppId;Password=MyPassword;ShopUrl=https://yourshopname.myshopify.com;
Oracle

 

Below is a JDBC URL for the Oracle Thin Client:

jdbc:shopify:Cache Driver=oracle.jdbc.driver.OracleDriver;CacheConnection='jdbc:oracle:thin:scott/tiger@localhost:1521:orcldb';AppId=MyAppId;Password=MyPassword;ShopUrl=https://yourshopname.myshopify.com;
PostgreSQL

 

The following JDBC URL uses the official PostgreSQL JDBC driver:

jdbc:shopify:CacheDriver=org.postgresql.Driver;CacheConnection='jdbc:postgresql://localhost:5433/postgres?user=postgres&password=admin';AppId=MyAppId;Password=MyPassword;ShopUrl=https://yourshopname.myshopify.com;

 

 

Cache Location

Data Type

string

Default Value

""

Remarks

The CacheLocation is a simple, file-based cache. The driver uses Java DB, Oracle's distribution of the Derby database. To cache to Java DB, you will need to add the Java DB JAR to the classpath. The JAR, derby.jar, is shipped in the JDK and located in the db subfolder of the JDK installation.

CacheLocation defaults to the directory specified by the Location setting.

See Also

 

 

  • AutoCache: Set this to implicitly create and maintain a cache for later offline use.
  • CacheMetadata: Set this to persist the Shopify catalog in CacheLocation.

 

 

Cache Metadata

Data Type

bool

Default Value

false

Remarks

As you execute queries with this property set, table metadata in the Shopify catalog are cached to the file store specified by CacheLocation if set or the user's home directory otherwise. A table's metadata will be retrieved only once, when the table is queried for the first time.

When to Use CacheMetadata

 

The driver automatically persists metadata in memory for up to two hours when you first discover the metadata for a table or view and therefore, CacheMetadata is generally not required. CacheMetadata becomes useful when metadata operations are expensive such as when you are working with large amounts of metadata or when you have many short-lived connections.

When Not to Use CacheMetadata

 

 

  • When you are working with volatile metadata: Metadata for a table is only retrieved the first time the connection to the table is made. To pick up new, changed, or deleted columns, you would need to delete and rebuild the metadata cache. Therefore, it is best to rely on the in-memory caching for cases where metdata will change often.
  • When you are caching to a database: CacheMetadata can only be used with CacheLocation. If you are caching to another database with the CacheDriver and CacheConnection properties, use AutoCache to cache implicitly. Or, use CACHE Statements to cache explicitly.

 

 

Cache Query Result

Data Type

bool

Default Value

false

Remarks

When CacheQueryResult and AutoCache are set, the rows returned from a SELECT query are cached in the cache database. The driver handles caching in a streaming fashion with each row being processed into the cache database from the original result set as you read the row from the returned ResultSet object. This ensures that the live data is not queried twice. Note that any rows you do not read from the returned ResultSet will not be updated in the cache.

 

Connection Life Time

Data Type

string

Default Value

"0"

Remarks

The maximum lifetime of a connection in seconds. Once the time has elapsed, the connection object is disposed. The default is 0 which indicates there is no limit to the connection lifetime.

 

Connect On Open

Data Type

bool

Default Value

false

Remarks

When set to 'true', a connection will be made to Shopify when the connection is opened. This property enables the 'Test Connection' feature available in various database tools.

This feature acts as a NOOP command as it is used to verify a connection can be made to Shopify and nothing from this initial connection is maintained.

Setting this property to 'false' may provide performance improvements (depending upon the number of times a connection is opened).

 

Firewall Password

Data Type

string

Default Value

""

Remarks

This property is passed to the proxy specified by FirewallServer and FirewallPort, following the authentication method specified by FirewallType.

 

Firewall Port

Data Type

string

Default Value

""

Remarks

This specifies the TCP port for a proxy allowing traversal of a firewall. Use FirewallServer to specify the name or IP address. Specify the protocol with FirewallType.

 

Firewall Server

Data Type

string

Default Value

""

Remarks

This property specifies the IP address, DNS name, or host name of a proxy allowing traversal of a firewall. The protocol is specified by FirewallType: Use FirewallServer with this property to connect through SOCKS or do tunneling. Use ProxyServer to connect to an HTTP proxy.

Note that the driver uses the system proxy by default. To use a different proxy, set ProxyAutoDetect to false.

 

Firewall Type

Data Type

string

Default Value

"NONE"

Remarks

This property specifies the protocol that the driver will use to tunnel traffic through the FirewallServer proxy. Note that by default the driver connects to the system proxy; to disable this behavior and connect to one of the following proxy types, set ProxyAutoDetect to false.

 

   
Type Default Port Description
TUNNEL 80 When this is set, the driver opens a connection to Shopify and traffic flows back and forth through the proxy.
SOCKS4 1080 When this is set, the driver sends data through the SOCKS 4 proxy specified by FirewallServer and FirewallPort and passes the FirewallUser value to the proxy, which determines if the connection request should be granted.
SOCKS5 1080 When this is set, the driver sends data through the SOCKS 5 proxy specified by FirewallServer and FirewallPort. If your proxy requires authentication, set FirewallUser and FirewallPassword to credentials the proxy recognizes.

 

To connect to HTTP proxies, use ProxyServer and ProxyPort. To authenticate to HTTP proxies, use ProxyAuthScheme, ProxyUser, and ProxyPassword.

 

 

Firewall User

Data Type

string

Default Value

""

Remarks

The FirewallUser and FirewallPassword properties are used to authenticate against the proxy specified in FirewallServer and FirewallPort, following the authentication method specified in FirewallType.

 

Location

Data Type

string

Default Value

""

Remarks

The path to a directory which contains the schema files for the driver (.rsd files for tables and views, .rsb files for stored procedures). The Location property is only needed if you would like to customize definitions (e.g., change a column name, ignore a column, etc.) or extend the data model with new tables, views, or stored procedures.

The schema files are deployed alongside the driver assemblies. You must also ensure that Location points to the folder that contains the schema files. The folder location can be a relative path from the location of the executable.

 

Logfile

Data Type

string

Default Value

""

Remarks

For more control over what is written to the log file, take a look at Verbosity.

 

Max Log File Size

Data Type

string

Default Value

"20MB"

Remarks

A string specifying the maximum size in bytes for a log file (ex: 10MB). When the limit is hit, a new log is created in the same folder with the date and time appended to the end. The default limit is 20MB. Values lower than 100kB will use 100kB as the value instead.

 

Offline

Data Type

bool

Default Value

false

Remarks

When Offline is set to TRUE, all queries execute against the cache as opposed to the live data source. In this mode, certain queries like INSERT, UPDATE, DELETE, and CACHE are not allowed.

 

Other

Data Type

string

Default Value

""

Remarks

The properties listed below are available for specific use cases. Normal driver use cases and functionality should not require these properties.

Specify multiple properties in a semicolon-separated list.

Caching Configuration

 

   
CachePartial=True Caches only a subset of columns, which you can specify in your query.
QueryPassthrough=True Passes the specified query to the cache database instead of using the SQL parser of the driver.

 

Integration and Formatting

 

   
DefaultColumnSize Sets the default length of string fields when the data source does not provide column length in the metadata. The default value is 2000.
ConvertDateTimeToGMT Whether to convert date-time values to GMT, instead of the local time of the machine.
RecordToFile=filename Records the underlying socket data transfer to the specified file.

 

 

Password

Data Type

string

Default Value

""

Remarks

 

Password for the admin API.

 

Pool Idle Timeout

Data Type

string

Default Value

""

Remarks

The allowed idle time from when the connection is free to when the connection is released and returned to the pool. The default is 60 seconds.

 

Pool Max Size

Data Type

string

Default Value

"100"

Remarks

The maximum connections in the pool. The default is 100. To disable this property, set the property value to 0 or less.

 

Pool Min Size

Data Type

string

Default Value

"1"

Remarks

The minimum number of connections in the pool. The default is 1.

 

Pool Wait Time

Data Type

string

Default Value

""

Remarks

The max seconds to wait for a connection to become available. If a new connection request is waiting for an available connection and exceeds this time, an error is thrown. By default, new requests wait forever for an available connection.

 

Proxy Auth Scheme

Data Type

string

Default Value

"BASIC"

Remarks

This value specifies the authentication type to use to authenticate to the HTTP proxy specified by ProxyServer and ProxyPort.

Note that the driver will use the system proxy settings by default, without further configuration needed; if you want to connect to another proxy, you will need to set ProxyAutoDetect to false, in addition to ProxyServer and ProxyPort. To authenticate, set ProxyAuthScheme and set ProxyUser and ProxyPassword, if needed.

The authentication type can be one of the following:

  • BASIC: The driver performs HTTP BASIC authentication.
  • DIGEST: The driver performs HTTP DIGEST authentication.
  • NEGOTIATE: The driver retrieves an NTLM or Kerberos token based on the applicable protocol for authentication.
  • PROPRIETARY: The driver does not generate an NTLM or Kerberos token. You must supply this token in the Authorization header of the HTTP request.
If you need to use another authentication type, such as SOCKS 5 authentication, see FirewallType.

 

 

Proxy Auto Detect

Data Type

bool

Default Value

true

Remarks

By default, the driver uses the system HTTP proxy. Set this to false if you want to connect to another proxy.

To connect to an HTTP proxy, see ProxyServer.

For other proxies, such as SOCKS or tunneling, see FirewallType.

 

Proxy Exceptions

Data Type

string

Default Value

""

Remarks

The ProxyServer will be used for all addresses, except for addresses defined in this property. Use semicolons to separate entries.

Note that the driver will use the system proxy settings by default, without further configuration needed; if you want to explicitly configure proxy exceptions for this connection, you will need to set ProxyAutoDetect to false, and configure ProxyServer and ProxyPort. To authenticate, set ProxyAuthScheme and set ProxyUser and ProxyPassword, if needed.

 

Proxy Password

Data Type

string

Default Value

""

Remarks

This property is used to authenticate to an HTTP proxy server that supports NTLM (Windows), Kerberos, or HTTP authentication. To specify the HTTP proxy, you can set ProxyServer and ProxyPort. To specify the authentication type, set ProxyAuthScheme.

If you are using HTTP authentication, additionally set ProxyUser and ProxyPassword to HTTP proxy.

If you are using NTLM authentication, set ProxyUser and ProxyPassword to your Windows password. You may also need these to complete Kerberos authentication.

For SOCKS 5 authentication or tunneling, see FirewallType.

By default, the driver uses the system proxy. If you want to connect to another proxy, set ProxyAutoDetect to false.

 

Proxy Port

Data Type

string

Default Value

"80"

Remarks

The port the HTTP proxy is running on that you want to redirect HTTP traffic through. Specify the HTTP proxy in ProxyServer. For other proxy types, see FirewallType.

 

Proxy Server

Data Type

string

Default Value

""

Remarks

The hostname or IP address of a proxy to route HTTP traffic through. The driver can use the HTTP, Windows (NTLM), or Kerberos authentication types to authenticate to an HTTP proxy.

If you need to connect through a SOCKS proxy or tunnel the connection, see FirewallType.

By default, the driver uses the system proxy. If you need to use another proxy, set ProxyAutoDetect to false.

 

Proxy SSL Type

Data Type

string

Default Value

"AUTO"

Remarks

This property determines when to use SSL for the connection to an HTTP proxy specified by ProxyServer. This value can be AUTO, ALWAYS, NEVER, or TUNNEL. The applicable values are the following:

 

   
AUTO Default setting. If the URL is an HTTPS URL, the driver will use the TUNNEL option. If the URL is an HTTP URL, the component will use the NEVER option.
ALWAYS The connection is always SSL enabled.
NEVER The connection is not SSL enabled.
TUNNEL The connection is through a tunneling proxy: The proxy server opens a connection to the remote host and traffic flows back and forth through the proxy.

 

 

Proxy User

Data Type

string

Default Value

""

Remarks

The ProxyUser and ProxyPassword options are used to connect and authenticate against the HTTP proxy specified in ProxyServer.

You can select one of the available authentication types in ProxyAuthScheme. If you are using HTTP authentication, set this to the username of a user recognized by the HTTP proxy. If you are using Windows or Kerberos authentication, set this property to a username in one of the following formats:

user@domain

domain\user

 

 

Pseudo Columns

Data Type

string

Default Value

""

Remarks

This setting is particularly helpful in Entity Framework, which does not allow you to set a value for a pseudo column unless it is a table column. The value of this connection setting is of the format "Table1=Column1, Table1=Column2, Table2=Column3". You can use the "*" character to include all tables and all columns; i.e., "*=*".

 

RTK

Data Type

string

Default Value

""

Remarks

 

The RTK property may be used to license a build. Please see the included licensing file to see how to set this property. The runtime key is only available if you purchased an OEM license.

 

Shop Url

Data Type

string

Default Value

""

Remarks

The full URL of your Shopify shop.

 

SSL Server Cert

Data Type

string

Default Value

""

Remarks

If using a TLS/SSL connection, this property can be used to specify the TLS/SSL certificate to be accepted from the server. Any other certificate that is not trusted by the machine will be rejected.

This property can take the forms:

 

   
Description Example
A full PEM Certificate (example shortened for brevity) -----BEGIN CERTIFICATE----- MIIChTCCAe4CAQAwDQYJKoZIhv......Qw== -----END CERTIFICATE-----
A path to a local file containing the certificate C:\cert.cer
The public key (example shortened for brevity) -----BEGIN RSA PUBLIC KEY----- MIGfMA0GCSq......AQAB -----END RSA PUBLIC KEY-----
The MD5 Thumbprint (hex values can also be either space or colon separated) ecadbdda5a1529c58a1e9e09828d70e4
The SHA1 Thumbprint (hex values can also be either space or colon separated) 34a929226ae0819f2ec14b4a3d904f801cbb150d

 

If not specified, any certificate trusted by the machine will be accepted. Use '*' to signify to accept all certificates (not recommended for security concerns).

 

Support Enhanced SQL

Data Type

bool

Default Value

true

Remarks

When SupportEnhancedSQL is set to true, the driver offloads as much of the SELECT statement processing as possible to Shopify and then processes the rest of the query in memory. In this way the driver can execute unsupported predicates, joins, and aggregation.

When SupportEnhancedSQL is set to false, the driver limits SQL execution to what is supported by the Shopify API.

Execution of Predicates

 

The driver determines which of the clauses are supported by the data source and then pushes them to the source to get the smallest superset of rows that would satisfy the query. It then filters the rest of the rows locally. The filter operation is streamed, which enables the driver to filter effectively for even very large datasets.

Execution of Joins

 

The driver uses various techniques to join in memory. The driver trades off memory utilization against the requirement of reading the same table more than once.

Execution of Aggregates

 

The driver retrieves all rows necessary to process the aggregation in memory.

 

Tables

Data Type

string

Default Value

""

Remarks

Listing the tables from some databases can be expensive. Providing a list of tables in the connection string improves the performance of the driver.

This property can also be used as an alternative to automatically listing views if you already know which ones you want to work with and there would otherwise be too many to work with.

Specify the tables you want in a comma-separated list. For example: Tables=TableA,TableB,TableC

 

Timeout

Data Type

string

Default Value

"60"

Remarks

If the Timeout property is set to 0, operations do not time out: They run until they complete successfully or encounter an error condition.

If Timeout expires and the operation is not yet complete, the driver throws an exception.

 

Use Connection Pooling

Data Type

bool

Default Value

false

Remarks

Enables connection pooling. The default is false. See Connection Pooling for information on using connection pools.

 

Verbosity

Data Type

string

Default Value

"1"

Remarks

The verbosity level determines the amount of detail that the driver reports to the Logfile. Verbosity levels from 1 to 5 are supported. These are described below:

 

   
1 Setting Verbosity to 1 will log the query, the number of rows returned by it, the start of execution and the time taken, and any errors.
2 Setting Verbosity to 2 will log everything included in Verbosity 1, cache queries, and additional information about the request, if applicable, such as HTTP headers.
3 Setting Verbosity to 3 will additionally log the body of the request and the response.
4 Setting Verbosity to 4 will additionally log transport-level communication with the data source. This includes SSL negotiation.
5 Setting Verbosity to 5 will additionally log communication with the data source and additional details that may be helpful in troubleshooting problems. This includes interface commands.

The Verbosity should not be set to greater than 1 for normal operation. Substantial amounts of data can be logged at higher verbosities, which can delay execution times.

 

Views

Data Type

string

Default Value

""

Remarks

Listing the views from some databases can be expensive. Providing a list of views in the connection string improves the performance of the driver.

This property can also be used as an alternative to automatically listing views if you already know which ones you want to work with and there would otherwise be too many to work with.

Specify the views you want in a comma-separated list. For example: For example: Views=ViewsA,ViewsB,ViewsC




 

Tables

  1. CustomerAddresses
  2. Customers
  3. Fulfillments
  4. Orders
  5. Products
  6. ProductVariants
  7. Refunds
  8. Transactions

CustomerAddresses

Create, update, delete, and query customer addresses.

 

Table-Specific Information
Select

 

The driver processes all filters client-side within the driver. The following query is the only one processed server side:

SELECT * FROM CustomerAddresses
You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria will cause an error.
Insert

 

You must specify the customer Id to create an address.

INSERT INTO CustomerAddresses(CustomerId, Address1, City, Company) VALUES('123', '1 Rue des Carrieres', 'Suite 1234', 'Montreal')
Update

 

You must specify the customer Id and the Id of the customer address to update an address.

UPDATE CustomerAddresses SET Zip='90210' WHERE CustomerId='123' AND Id='456'
Delete

 

You must specify the customer Id and the Id of the customer address to delete an address. You cannot delete a customer's default address.

DELETE FROM CustomerAddresses WHERE CustomerId='183467180055' AND Id='292265787415'
Columns

 

 

 

   
Name Type ReadOnly Description
Id [KEY] String True

A unique numeric identifier for the address.

CustomerId [KEY] String False

A unique numeric identifier for the customer.

Name String False

The customer's name.

FirstName String False

The customer's first name.

LastName String False

The customer's last name.

Company String False

The customer's company.

Address1 String False

The customer's mailing address.

Address2 String False

An additional field for the customer's mailing address.

City String False

The customer's city.

Province String False

The customer's province or state name.

Country String False

The customer's country.

Zip String False

The customer's zip or postal code.

Phone String False

The customer's phone number for this mailing address.

ProvinceCode String False

The two-letter pcode for the customer's province or state.

CountryCode String False

The two-letter country code corresponding to the customer's country.

CountryName String False

The customer's normalized country name.

Default Boolean True

Indicates whether this address is the default address for the customer.

 

 

 

Customers

Create, update, delete, and query customers.

 

Table-Specific Information
Select

 

The driver uses the Shopify API to process search criteria that refer to the Id, CreatedAt, and UpdatedAt columns. The driver processes other filters client-side within the driver. For example, the following queries are processed server side.

SELECT * FROM Customers



SELECT * FROM Customers WHERE Id = '123'



SELECT * FROM Customers WHERE Id IN ('123', '456')



SELECT * FROM Customers WHERE CreatedAt > '2017-10-25'
Insert

 

The Email field is required to insert.

INSERT INTO Customers(Email, Phone) VALUES('steve.lastnameson@example.com', '+15142546011')



INSERT INTO Customers(Email, Phone, SendEmailInvite) VALUES('steve.lastnameson@example.com', '+15142546011', true)
Update

 

 

You must specify the Id of the customer to update a customer.

UPDATE Customers SET Note='Customer is a great guy' WHERE Id='123'



UPDATE Customers SET Tags='New Customer, Repeat Customer' WHERE Id='123'
Delete

 

You must specify the Id of the customer to delete a customer.

DELETE FROM Customers WHERE Id='123'
Columns

 

 

 

   
Name Type ReadOnly Description
Id [KEY] String True

A unique numeric identifier for the customer.

LastOrderId String True

The id of the customer's last order.

LastOrderName String True

The name of the customer's last order.

FirstName String False

The customer's first name.

LastName String False

The customer's last name.

Email String False

The unique email address of the customer.

Phone String False

The unique phone number for this customer.

TaxExempt Boolean False

Indicates whether the customer should be charged taxes when placing orders.

TotalSpent Double True

The total amount of money that the customer has spent at the shop.

OrdersCount Integer True

The number of orders associated with this customer.

AcceptsMarketing Boolean True

Indicates whether the customer has consented to be sent marketing material via email.

MultipassIdentifier String True

The customer's identifier used with Multipass login.

Note String False

A note about the customer.

State String True

The state of the customer's account in a shop.

Tags String False

The tags for this customer. Separate with comma for multiple tags.

VerifiedEmail Boolean True

States whether or not the email address has been verified.

CreatedAt Datetime True

The date and time when the customer was created.

UpdatedAt Datetime True

The date and time when the customer information was updated.

 

Pseudo-Columns

 

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

 

 

   
Name Type Description
Password String

Password of the customer

PasswordConfirmation String

Password confirmation of the customer.

SendEmailWelcome Boolean

Whether to send a welcome email to the customer or not.

SendEmailInvite Boolean

Whether to send an invite email to the customer or not.

 

 

 

Fulfillments

Create, update, and query fulfillments.

 

Table-Specific Information
Select

 

The driver uses the Shopify API to process search criteria that refer to the Id, OrderId, CreatedAt, and UpdatedAt columns. The driver processes other filters client-side within the driver. For example, the following queries are processed server side.

  • If you specify the unique identifier of the order, then this view will only list fulfillment information concerning that order. You can also retrieve a specific fulfillment by specifying OrderId and Id.

    SELECT * FROM Fulfillments
    
    
    
    SELECT * FROM Fulfillments WHERE OrderId = '123'
    
    
    
    SELECT * FROM Fulfillments WHERE OrderId = '123' AND Id='567'

     

  • This view supports filtering by the CreatedAt and UpdatedAt columns on the server side.

    SELECT * FROM Fulfillments WHERE CreatedAt > '2017-10-25'

     

Insert

 

You must specify the OrderId column to insert a fulfillment.

  • Fulfill one line item.

    INSERT INTO Fulfillments(OrderId, ItemId1) VALUES('123', '456')

     

  • Fulfill many line items.

    INSERT INTO Fulfillments(OrderId, ItemId1, ItemId2, ItemId3) VALUES('123', '456', '789', '012')

     

  • Fulfill all line items, notify the customer, and set a tracking number.

    INSERT INTO Fulfillments(OrderId, TrackingNumbers, NotifyCustomer) VALUES('123', 'FEDEX1', true)

     

  • Partially fulfill a single line item by explicitly specifying the line item and quantity to be fulfilled.

    INSERT INTO Fulfillments(OrderId, ItemId1, ItemQuantity1) VALUES('123', '456', 1)

     

  • Complete a fulfillment (you must specify the Id of the fulfillment as well).

    INSERT INTO Fulfillments(OrderId, Id, Operation) VALUES('123', '456', 'Complete')    

     

  • Transition a fulfillment from pending to open (you must specify the Id of the fulfillment as well).

    INSERT INTO Fulfillments(OrderId, Id, Operation) VALUES('123', '456', 'Open')

     

  • Cancel a fulfillment (you must specify Id of the fulfillment as well).

    INSERT INTO Fulfillments(OrderId, Id, Operation) VALUES('123', '456', 'Cancel')

     

Update

 

You must specify the OrderId and Id of the fulfillment to fulfill an order.

UPDATE Fulfillments SET TrackingNumbers='FedEx123,UPS123' WHERE OrderId='123' AND Id='456'
Columns

 

 

 

   
Name Type ReadOnly Description
Id [KEY] String True

A unique numeric identifier for the fulfillment.

OrderId [KEY] String False

A unique numeric identifier for the order.

NotifyCustomer Boolean False

A flag indicating whether the customer should be notified

Status String True

The status of the fulfillment.

Receipt String True

Provides information about the receipt of this fulfillment.

TrackingCompany String False

The name of the tracking company.

TrackingNumbers String False

A list of comma-separated tracking numbers, provided by the shipping company.

TrackingUrls String True

The sum of all the prices of all the items in the fulfillment.

VariantInventoryManagement String True

States the name of the inventory management service.

CreatedAt Datetime True

The date and time when the fulfillment was created.

UpdatedAt Datetime True

The date and time when the fulfillment was last modified.

 

Pseudo-Columns

 

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

 

 

   
Name Type Description
Operation String

An operation to apply to the fulfillment. Complete, Open, or Cancel.

The allowed values are Complete, Open, Cancel.

Item* String

All line-item-specific columns may be used in insertions.

 

 

 

Orders

Create, update, delete, and query orders.

 

Table-Specific Information
Select

 

 

The driver uses the Shopify API to process search criteria that refer to the following columns. The driver processes other filters client-side within the driver. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error.

SELECT * FROM Orders



SELECT * FROM Orders WHERE Id='123'



SELECT * FROM Orders WHERE CustomerId='123'
  • If you set the IsDraftOrder pseudo column to true, then this table will list draft orders instead of orders.

    SELECT * FROM Orders WHERE IsDraftOrder = true
    
    
    
    SELECT * FROM Orders WHERE IsDraftOrder = true AND Id='123'

     

  • This view supports server-side filtering by the following columns: FinancialStatus (orders only), FulfillmentStatus (orders only), CreatedAt (orders only), ProcessedAt (orders only) and UpdatedAt.

    SELECT * FROM Orders WHERE FinancialStatus = 'pending'
    
    
    
    SELECT * FROM Orders WHERE CreatedAt > '2017-10-25'

     

Insert
  • Create a simple order with only a product variant Id.

    INSERT INTO Orders(ItemVariantId1, ItemQuantity1) VALUES('123', 1)

     

  • Create a simple order, sending the order receipt and fulfillment receipt to the customer.

    INSERT INTO Orders(Email, FulfillmentStatus, SendReceipt, SendFulfillmentReceipt, ItemVariantId1, ItemQuantity1, ItemVariantId2, ItemQuantity2) VALUES('foo@example.com', 'fulfilled', true, true, '123', 1, '456', 8)

     

  • Create a simple order, with taxes.

    INSERT INTO Orders(ItemVariantId1, ItemQuantity1, ItemVariantId2, ItemQuantity2, TaxItemPrice1, TaxItemRate1, TaxItemTitle1) VALUES('4236041945111', 1, '4236069011479', 1, 10.2, 0.06, 'State Tax')

     

  • Create a simple order, with multiple taxes.

    INSERT INTO Orders(ItemVariantId1, ItemQuantity1, ItemVariantId2, ItemQuantity2, TaxItemPrice1, TaxItemRate1, TaxItemTitle1, TaxItemPrice2, TaxItemRate2, TaxItemTitle2) VALUES('4236041945111', 1, '4236069011479', 1, 10.2, 0.06, 'State Tax', 4.25, 0.025, 'County Tax')

     

  • Create a simple partially paid order containing a captured transaction.

    INSERT INTO Orders(ItemTitle1, ItemQuantity1, ItemPrice1, FinancialStatus, TransactionItemAmount1, TransactionItemKind1, TransactionItemStatus1, TransactionItemGateway1) VALUES('Big Brown Bear Boots', 8, 25.99, 'partially_paid', 52.57, 'capture', 'success', 'bogus')

     

  • Create a more comprehensive order.

    INSERT INTO Orders(ItemTitle1, ItemPrice1, ItemGrams1, ItemQuantity1) VALUES('Big Brown Bear Boots', 74.99, 1300, 3)

     

  • Create a pending order with an existing customer.

    INSERT INTO Orders(ItemVariantId1, ItemQuantity1, CustomerId, FinancialStatus) VALUES('123', 3, '456', 'pending')

     

  • Create a partially paid order with a new customer and addresses.

    INSERT INTO Orders(ItemVariantId1, ItemQuantity1, CustomerFirstName, CustomerLastName, CustomerEmail, FinancialStatus) VALUES('123', 3, 'Paul', 'Norman', 'paul.norman@example.com', 'partially_paid')

     

  • Close an order (you must specify the Id of the order).

      INSERT INTO Orders(Id, Operation) VALUES('123', 'Close')
    
      

     

  • Reopen an order (you must specify the Id of the order).

      INSERT INTO Orders(Id, Operation) VALUES('123', 'Open')
    
      

     

  • Cancel an order (you must specify the Id of the order).

      INSERT INTO Orders(Id, Operation) VALUES('123', 'Cancel')
    
      

     

  • If you set the IsDraftOrder pseudo column to true, then this table will insert draft orders instead of orders.

    Create a simple draft order with only a product variant Id.

      INSERT INTO Orders(IsDraftOrder, ItemVariantId1, ItemQuantity1) VALUES(true, '456', 3)
    
      

     

    Create a custom draft order.

      INSERT INTO Orders(IsDraftOrder, ItemTitle1, ItemPrice1, ItemQuantity1, CustomerId) VALUES(true, 'Custom Tee', 20.15, 2, '456')
    
      

     

Update

 

If you set the IsDraftOrder pseudo column to true, then this table will update draft orders instead of orders.

  • Update the shipping address of an existing order.

    UPDATE Orders SET ShippingAddressAddress1='123 Ship Street', ShippingAddressCity='Shipsville' WHERE Id='123'

     

  • Update an order's tags.

    UPDATE Orders SET Tags='External, Inbound, Outbound' WHERE Id='123'

     

  • Set a discount on a draft order.

    UPDATE Orders SET AppliedDiscountDescription='Custom discount', AppliedDiscountValueType='percentage', AppliedDiscountValue=10.2, AppliedDiscountAmount=19.9, AppliedDiscountTitle='Custom' WHERE Id='123' AND IsDraftOrder=true

     

  • Add a note to a draft order.

    UPDATE Orders SET Note='Customer contacted us about a custom engraving on this iPod' WHERE Id='123' AND IsDraftOrder=true

     

Delete

 

You must specify the Id of the order or draft order when deleting an item from this table.

If you set the IsDraftOrder pseudo column to true, then this table will delete draft orders instead of orders.

DELETE FROM Orders WHERE Id='123'



DELETE FROM Orders WHERE Id='123' AND IsDraftOrder=true
Columns

 

 

 

   
Name Type ReadOnly Description
Id [KEY] String True

A unique numeric identifier for the order.

CustomerId String False

A unique numeric identifier for the customer.

Currency String False

The three letter code (ISO 4217) for the currency used for the payment.

Email String False

The customer's email address.

Name String True

The customer's order name as represented by a number.

TotalDiscounts Double True

The total amount of the discounts to be applied to the price of the order.

TotalOrderItemsPrice Double True

The sum of all the prices of all the items in the order.

TotalPrice Double True

The sum of all the prices of all the items in the order, taxes and discounts included.

SubtotalPrice Double True

Price of the order before shipping and taxes.

TotalTax Double False

The sum of all the taxes applied to the order.

TotalWeight Integer True

The sum of all the weights of the line items in the order, in grams.

BrowserIp String True

The IP address of the browser used by the customer when placing the order.

BuyerAcceptsMarketing Boolean False

Indicates whether or not the person who placed the order would like to receive email updates from the shop.

CancelReason String True

The reason why the order was canceled.

CartToken String True

Unique identifier for a particular cart that is attached to a particular order.

OrderStatusUrl String True

The URL pointing to the order status web page.

Token String True

Unique identifier for a particular order.

TaxesIncluded Boolean False

States whether or not taxes are included in the order subtotal.

SourceName String True

Where the order originated.

ReferringSite String True

The website that the customer clicked on to come to the shop.

ProcessingMethod String True

States the type of payment processing method.

Phone String False

The customer's phone number.

Note String False

The text of an optional note that a shop owner can attach to the order.

LocationId String True

The unique numeric identifier for the physical location at which the order was processed.

LandingSite String True

The URL for the page where the buyer landed when entering the shop.

Tags String False

Additional short descriptors.

FulfillmentStatus String False

The fulfillment status of the order.

FinancialStatus String False

The financial status of the order.

DiscountCodes String True

Applicable discount codes that can be applied to the order.

CustomerLocale String True

The customer locale of the order.

InvoiceSentAt Datetime True

This auto-generated property is the date and time when the invoice was emailed to the customer. Only available for draft orders.

InvoiceUrl String True

The URL for the invoice. Only available for draft orders.

TaxExempt Boolean True

States whether or not taxes are exempt for this order. Only available for draft orders.

Status String True

The status of the order. Only available for draft orders.

BillingAddressFirstName String False

The first name of the person associated with the payment method.

BillingAddressLastName String False

The last name of the person associated with the payment method.

BillingAddressAddress1 String False

The street address of the billing address.

BillingAddressAddress2 String False

An optional additional field for the street address of the billing address.

BillingAddressPhone String False

The phone number at the billing address.

BillingAddressCity String False

The city of the billing address.

BillingAddressCompany String False

The company of the person associated with the billing address.

BillingAddressZip String False

The zip or postal code of the billing address.

BillingAddressProvince String False

The name of the state or province of the billing address.

BillingAddressCountry String False

The name of the country of the billing address.

BillingAddressLatitude Double False

The latitude of the billing address.

BillingAddressLongitude Double False

The longitude of the billing address.

BillingAddressName String False

The full name of the person associated with the payment method.

BillingAddressCountryCode String False

The two-letter code for the country of the billing address.

BillingAddressProvinceCode String False

The two-letter abbreviation of the state or province of the billing address.

BillingAddressDefault Boolean False

Whether this address is the default one or not.

ShippingAddressFirstName String False

The first name of the person associated with the shipping method.

ShippingAddressLastName String False

The last name of the person associated with the shipping method.

ShippingAddressAddress1 String False

The street address of the shipping address.

ShippingAddressAddress2 String False

An optional additional field for the street address of the shipping address.

ShippingAddressPhone String False

The phone number at the shipping address.

ShippingAddressCity String False

The city of the shipping address.

ShippingAddressCompany String False

The company of the person associated with the shipping address.

ShippingAddressZip String False

The zip or postal code of the shipping address.

ShippingAddressProvince String False

The name of the state or province of the shipping address.

ShippingAddressCountry String False

The name of the country of the shipping address.

ShippingAddressLatitude Double False

The latitude of the shipping address.

ShippingAddressLongitude Double False

The longitude of the shipping address.

ShippingAddressName String False

The full name of the person associated with the shipping method.

ShippingAddressCountryCode String False

The two-letter code for the country of the shipping address.

ShippingAddressProvinceCode String False

The two-letter abbreviation of the state or province of the shipping address.

ShippingAddressDefault Boolean False

Whether this address is the default one or not.

AppliedDiscountTitle String False

The title of the applied discount for this order. Only available for draft orders.

AppliedDiscountDescription String False

The description of the applied discount for order. Only available for draft orders.

AppliedDiscountValue Double False

The value of the applied discount for this order. Only available for draft orders.

AppliedDiscountValueType String False

The value type of the applied discount for order. Only available for draft orders.

AppliedDiscountAmount Double False

The amount of the applied discount for this order. Only available for draft orders.

ProcessedAt Datetime True

The date and time when the order was imported, in ISO 8601 format.

CreatedAt Datetime True

The date and time when the order was created.

ClosedAt Datetime True

The date and time when the order was closed.

CancelledAt Datetime True

The date and time when the order was canceled.

UpdatedAt Datetime True

The date and time when the order was last modified.

 

Pseudo-Columns

 

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

 

 

   
Name Type Description
SendReceipt Boolean

Determines whether an order confirmation will be sent to the customer.

The default value is false.

SendFulfillmentReceipt Boolean

Determines whether a fulfillment confirmation will be sent to the customer.

The default value is false.

InventoryBehaviour String

Determines which inventory updating behavior is used. The following values are available: default, decrement_ignoring_policy, decrementobeying_policy

The allowed values are default, decrement_ignoring_policy, decrementobeying_policy.

The default value is default.

CustomerFirstName String

The first name of the customer.

CustomerLastName String

The last name of the customer.

CustomerEmail String

The email of the customer.

Operation String

An operation to apply to the Order. Valid values for order: Close, Open, or Cancel.

The allowed values are Close, Open, Cancel.

Item* String

All line-item-specific columns may be used in insertions.

TaxItem* String

All tax line-item-specific columns may be used in insertions.

TransactionItem* String

All transaction line-item-specific columns may be used in insertions.

IsDraftOrder Boolean

Set to true to work with draft orders

The default value is false.

 

 

 

Products

Create, update, delete, and query products.

 

Table-Specific Information
Select

 

The driver uses the Shopify API to process search criteria that refer to the following columns: Id, Title, Vendor, Handle, ProductType, CreatedAt, PublishedAt, and UpdatedAt. The driver processes other filters client-side within the driver. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error.

For example, the following queries are processed server side.

SELECT * FROM Products



SELECT * FROM Products WHERE Id = '123'



SELECT * FROM Products WHERE CreatedAt > '2017-10-25'



SELECT * FROM Products WHERE Title = 'just a title'



SELECT * FROM Products WHERE Vendor = 'just a vendor'
Insert
  • Create a new product with the default product variant.

    INSERT INTO Products(Title, BodyHtml, Vendor, ProductType, Tags) VALUES('Burton Custom Freestyle 151', 'Good snowboard!', 'Burton', 'Snowboard', 'Barnes & Noble, Johns Fav, Big Air')

     

  • Create a new unpublished product.

    INSERT INTO Products(Title, BodyHtml, Vendor, ProductType, Tags, Published) VALUES('Burton Custom Freestyle 151', 'Good snowboard!', 'Burton', 'Snowboard', 'Barnes & Noble, Johns Fav, Big Air', false)

     

Update

 

To update a product you must specify its Id.

UPDATE Products SET Published=true  WHERE Id='123'



UPDATE Products SET MetafieldsGlobalTitleTag='Brand new title', MetafieldsGlobalDescriptionTag='Brand new description'  WHERE Id='123'
Delete

 

To delete a product you must specify its Id.

DELETE FROM Products WHERE Id='123'
Columns

 

 

 

   
Name Type ReadOnly Description
Id [KEY] String True

A unique numeric identifier for the product.

BodyHtml String False

The description of the product, complete with HTML formatting.

Handle String True

A human-friendly unique string for the Product automatically generated from its title.

Images String False

A list of image objects.

ProductType String False

A categorization that a product can be tagged with, commonly used for filtering and searching.

Options String True

Custom product property names.

PublishedScope String False

Indicates whether the product is published to the Point of Sale channel.

Tags String False

A categorization that a product can be tagged with. Use commas to separate categories.

TemplateSuffix String True

The suffix of the liquid template being used.

Title String False

The name of the product.

Vendor String False

The name of the vendor of the product.

PublishedAt Datetime True

The date and time when the product was published to the Online Store channel.

CreatedAt Datetime True

The date and time when the product was created.

UpdatedAt Datetime True

The date and time when the product was last modified.

 

Pseudo-Columns

 

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

 

 

   
Name Type Description
Published Boolean

Set to true to publish the product or to false to not publish it

MetafieldsGlobalTitleTag String

The name of the product, to be used for SEO purposes.

MetafieldsGlobalDescriptionTag String

The description of the product, to be used for SEO purposes.

 

 

 

ProductVariants

Create, update, delete, and query product variants.

 

Table-Specific Information
Select

 

The driver uses the Shopify API to process search criteria that refer to the Id and ProductId column. The driver processes other filters client-side within the driver. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error.

For example, the following queries are processed server side.

SELECT * FROM ProductVariants



SELECT * FROM ProductVariants WHERE Id = '123'



SELECT * FROM ProductVariants WHERE ProductId = '456'
Insert

 

You must specify the ProductId to insert a product variant.

INSERT INTO ProductVariants(ProductId, Option1, Price) VALUES('123', 'Yellow', 3.5)
Update

 

You must specify the Id of the variant to edit a product variant.

  • Update a variant's inventory using an adjustment.

    UPDATE ProductVariants SET InventoryQuantityAdjustment='-5'  WHERE Id='123'
    
    
    
    UPDATE ProductVariants SET InventoryQuantityAdjustment='+3'  WHERE Id='123'

     

  • Update the title and price of an existing variant.

    UPDATE ProductVariants SET Option1='Pink', Price=99.99  WHERE Id='123'

     

  • Update a variant's inventory.

    UPDATE ProductVariants SET InventoryQuantity=100, OldInventoryQuantity=10  WHERE Id='123'

     

Delete

 

You must specify the ProductId and the Id of the variant to delete a product variant.

DELETE FROM ProductVariants WHERE Id='123' AND ProductId='456'
Columns

 

 

 

   
Name Type ReadOnly Description
Id [KEY] String True

A unique numeric identifier for the product variant.

ProductId [KEY] String False

A unique numeric identifier for the product this variant belongs to.

ImageId String False

A unique numeric identifier for the image this variant belongs to.

Price Double False

The price of the product variant.

CompareAtPrice String False

The competitors prices for the same item.

Title String True

The title of the product variant.

Grams Integer False

The weight of the product variant in grams.

Barcode String False

The bar-code, UPC or ISBN number for the product.

Weight Integer False

The weight of the product variant in the unit system specified

WeightUnit String False

The unit of measurement that applies to the product's variant weight.

FulfillmentService String True

Service which is doing the fulfillment.

InventoryManagement String False

Specifies whether or not Shopify tracks the number of items in stock for this product variant.

The default value is shopify.

InventoryPolicy String False

Specifies whether or not customers are allowed to place an order for a product variant when it's out of stock. Valid values are deny or continue

The allowed values are deny, continue.

The default value is deny.

InventoryQuantity Integer False

The number of items in stock for this product variant. Default value 1.

OldInventoryQuantity Integer False

The original stock level the client believes the product variant has.

Option1 String False

Custom properties that a shop owner can use to define product variants.

Option2 String False

Custom properties that a shop owner can use to define product variants.

Option3 String False

Custom properties that a shop owner can use to define product variants.

Position Integer False

The order of the product variant in the list of product variants.

RequiresShipping Boolean False

Specifies whether or not a customer needs to provide a shipping address when placing an order for this product variant.

Sku String False

A unique identifier for the product in the shop.

Taxable Boolean False

Specifies whether or not a tax is charged when the product variant is sold.

CreatedAt Datetime True

The date and time when the product variant was created.

UpdatedAt Datetime True

The date and time when the product variant was last modified.

 

Pseudo-Columns

 

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

 

 

   
Name Type Description
InventoryQuantityAdjustment String

The inventory quantity adjustment for product variant.

 

 

 

Refunds

Create, and query refunds.

 

Table-Specific Information
Select

 

The driver uses the Shopify API to process search criteria that refer to the Orderid column. The driver processes other filters client-side within the driver. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error.

For example, the following queries are processed server side. If you specify the unique identifier of the Order, then this view will only list refund information concerning that order.

SELECT * FROM Refunds



SELECT * FROM Refunds WHERE OrderId = '123'
Insert

 

You must specify the OrderId when inserting a refund.

  • Calculate a refund for a line item and shipping.

    INSERT INTO Refunds(OrderId, CalculateRefund, ShippingFullRefund, ItemId1, ItemQuantity1) VALUES('123', true, true, '456', 5)

     

  • Calculate a refund for a partial amount of shipping.

    INSERT INTO Refunds(OrderId, CalculateRefund, ShippingAmount) VALUES('123', true, 2.56)

     

  • Create a new refund for an order.

    INSERT INTO Refunds(OrderId, Restock, Notify, Note, ShippingFullRefund, ItemId1, ItemQuantity1) VALUES('123', true, true, 'Wrong size', true, '456', 4)

     

  • Create a new refund for an order and attach a transaction to the refund as well.

    INSERT INTO Refunds(OrderId, ItemId1, ItemQuantity1, TransactionItemParentId1, TransactionItemAmount1, TransactionItemKind1, TransactionItemGateway1) VALUES('123', '456', 1, '789', 5.5, 'refund', 'bogus')

     

  • Refund a specific amount of shipping.

    INSERT INTO Refunds(OrderId, ShippingAmount, TransactionItemParentId1) VALUES('123', 5.3, '456')

     

Columns

 

 

 

   
Name Type ReadOnly Description
Id [KEY] String True

The unique identifier for the refund.

OrderId String False

The id of the order.

Note String False

The optional note attached to a refund.

Restock Boolean False

Whether or not the line items were added back to the store inventory.

UserId String True

The unique identifier of the user who performed the refund.

CreatedAt Datetime True

The date and time when the refund was created.

ProcessedAt Datetime True

The date and time when the refund was imported.

 

Pseudo-Columns

 

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

 

 

   
Name Type Description
Notify Boolean

Whether or not to send a refund notification to the customer.

DiscrepancyReason String

An optional comment, used if there is a discrepancy between calculated and actual refund amounts (one of: restock, damage, customer, other)

ShippingAmount Double

Set specific amount of shipping to refund. Takes precedence over FullRefund.

ShippingFullRefund Boolean

Whether or not to to refund all remaining shipping.

CalculateRefund Boolean

Set to true to simply calculate the refund but not process it

The default value is false.

Item* String

All line-item-specific columns may be used in insertions.

TransactionItem* String

All transaction line-item-specific columns may be used in insertions.

 

 

 

Transactions

Create, and query transactions.

 

Table-Specific Information
Select

 

The driver uses the Shopify API to process search criteria that refer to the OrderId column. The driver processes other filters client-side within the driver. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error.

For example, the following queries are processed server side. If you specify the unique identifier of the Order, then this view will only list transaction information concerning that order.

SELECT * FROM Transactions



SELECT * FROM Transactions WHERE OrderId = '123'
Insert

 

You must specify the OrderId and Kind when inserting a transaction.

  • Capture a specified amount on a previously authorized order.

    INSERT INTO Transactions(OrderId, Amount, Kind) VALUES('123', 10.25, 'Capture')

     

  • Capture a previously authorized order for the full amount.

    INSERT INTO Transactions(OrderId, Kind) VALUES('123', 'Capture')

     

Columns

 

 

 

   
Name Type ReadOnly Description
Id [KEY] String True

A unique numeric identifier for the transaction.

OrderId String False

A unique numeric identifier for the order.

UserId String True

The unique identifier for the user.

Amount Double False

The amount of money that the transaction was for.

Authorization String True

The authorization code associated with the transaction.

Currency String True

The three letter code (ISO 4217) for the currency used for the payment.

DeviceId String True

The unique identifier for the device.

Gateway String False

The name of the gateway the transaction was issued through.

SourceName String True

The origin of the transaction.

Kind String False

The kind of transaction. Can be any of the following: Authorization, Capture, Sale, Void, Refund.

The allowed values are Authorization, Capture, Sale, Void, Refund.

Message String True

The message associated with this transaction.

ErrorCode String True

A standardized error code, independent of the payment provider.

Status String False

The status of the transaction.

Test Boolean True

The option to use the transaction for testing purposes.

AVSResultCode String True

The Response code from the address verification system.

CreditCardBin String True

The issuer identification number (IIN).

CVVResultCode String True

The Response code from the credit card company.

CreditCardNumber String True

The customer's credit card number, with most of the leading digits redacted with Xs.

CreditCardCompany String True

The name of the company who issued the customer's credit card.

CreatedAt Datetime True

The date and time when the customer was created.

 

Pseudo-Columns

 

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

 

 

   
Name Type Description
TransactionItemAmount# Double

The amount of money that the transaction was for. Use this when inserting transactions into an order or refund.

TransactionItemGateway# String

The name of the gateway the transaction was issued through. Use this when inserting transactions into an order or refund.

TransActionItemKind# String

The kind of transaction. Can be any of the following: Authorization, Capture, Sale, Void, Refund. Use this when inserting transactions into an order or refund.

The allowed values are Authorization, Capture, Sale, Void, Refund.

TransactionItemStatus# String

The status of the transaction. Use this when inserting transactions into an order or refund.

TransactionItemParentId# String

The parent id of the transaction. Use this when inserting transactions into a refund.

 

 




 

Views

  1. AbandonedCheckouts
  2. OrderItems
  3. ProductOptions
  4. ShippingItems
  5. Shop
  6. TaxItems

AbandonedCheckouts

Query abandoned checkouts.

 

View-Specific Information
Select

 

The driver uses the Shopify API to process search criteria that refer to the CreatedAt and UpdatedAt columns. The driver processes other filters client-side within the driver. For example, the following queries are processed server side.

SELECT * FROM AbandonedCheckouts



SELECT * FROM AbandonedCheckouts WHERE CreatedAt > '2017-10-25'
You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error.
Columns

 

 

 

   
Name Type Description
Id String The unique numeric identifier for the order.
AbandonedCheckoutUrl String The full recovery URL to be sent to a customer to recover their abandoned checkout.
BuyerAcceptsMarketing Boolean Indicates whether or not the person who placed the order would like to receive email updates from the shop.
CancelReason String The reason why the order was cancelled.
CartToken String Unique identifier for a particular cart that is attached to a particular order.
Currency String The three letter code (ISO 4217) for the currency used for the payment.
CustomerId String A unique numeric identifier for the customer.
DiscountCodes String Applicable discount codes that can be applied to the order.
Email String The customer's email address.
Note String The text of an optional note that a shop owner can attach to the order.
LandingSite String The URL for the page where the buyer landed when entering the shop.
ReferringSite String The website that the customer clicked on to come to the shop.
SourceName String Where the order originated.
SubtotalPrice Double Price of the order before shipping and taxes.
TotalDiscounts Double The total amount of the discounts to be applied to the price of the order.
TotalLineItemsPrice Double The sum of all the prices of all the items in the order.
TotalPrice Double The sum of all the prices of all the items in the order, taxes and discounts included.
TotalTax Double The sum of all the taxes applied to the order.
TotalWeight Double The sum of all the weights of the line items in the order, in grams.
TaxesIncluded Boolean States whether or not taxes are included in the order subtotal.
Token String Unique identifier for a particular order.
BillingAddressFirstName String The first name of the person associated with the payment method.
BillingAddressLastName String The last name of the person associated with the payment method.
BillingAddressAdress1 String The street address of the billing address.
BillingAddressAdress2 String An optional additional field for the street address of the billing address.
BillingAddressPhone String The phone number at the billing address.
BillingAddressCity String The city of the billing address.
BillingAddressCompany String The company of the person associated with the billing address.
BillingAddressZip String The zip or postal code of the billing address.
BillingAddressProvince String The name of the state or province of the billing address.
BillingAddressCountry String The name of the country of the billing address.
BillingAddressLatitude Double The latitude of the billing address.
BillingAddressLongitude Double The longitude of the billing address.
BillingAddressName String The full name of the person associated with the payment method.
BillingAddressCountryCode String The two-letter code for the country of the billing address.
BillingAddressProvinceCode String The two-letter abbreviation of the state or province of the billing address.
BillingAddressDefault Boolean Whether this address is the default one or not.
ShippingAddressFirstName String The first name of the person associated with the shipping address.
ShippingAddressLastName String The last name of the person associated with the shipping address.
ShippingAddressAdress1 String The street address of the shipping address.
ShippingAddressAdress2 String An optional additional field for the street address of the shipping address.
ShippingAddressPhone String The phone number at the shipping address.
ShippingAddressCity String The city of the shipping address.
ShippingAddressCompany String The company of the person associated with the shipping address.
ShippingAddressZip String The zip or postal code of the shipping address.
ShippingAddressProvince String The name of the state or province of the shipping address.
ShippingAddressCountry String The name of the country of the shipping address.
ShippingAddressLatitude Double The latitude of the shipping address.
ShippingAddressLongitude Double The longitude of the shipping address.
ShippingAddressName String The full name of the person associated with the shipping address.
ShippingAddressCountryCode String The two-letter code for the country of the shipping address.
ShippingAddressProvinceCode String The two-letter abbreviation of the state or province of the shipping address.
ShippingAddressDefault Boolean Whether this address is the default one or not.
ClosedAt Datetime The date and time when the order was closed.
CompletedAt Datetime  
CreatedAt Datetime The date and time when the order was created.
UpdatedAt Datetime The date and time when the order was last modified.

 

 

 

OrderItems

Query order items.

 

View-Specific Information
Select

 

The driver uses the Shopify API to process search criteria that refer to the OrderId column and Type pseudo column. The driver processes other filters client-side within the driver. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error.

For example, the following queries are processed server side. You can set the Type pseudo column to "DraftOrder" to list order items belonging to draft orders instead of orders, or you can set Type to "AbandonedCheckout" to list order items belonging to abandoned checkouts.

SELECT * FROM OrderItems



SELECT * FROM OrderItems WHERE OrderId = '123'



SELECT * FROM OrderItems WHERE Type = 'DraftOrder'



SELECT * FROM OrderItems WHERE Type = 'AbandonedCheckout'
Columns

 

 

 

   
Name Type Description
ItemId# String The id of the order item. Only available for orders.
OrderId String The id of the order.
ProductId String The id of the of the product beloning to the order item.
ItemVariantId# String The id of the product variant.
ItemTitle# String The title of the product.
Name String The name of the product variant.
ItemQuantity# Integer The number of products that were purchased.
ItemPrice# Double The price of the item before discounts have been applied.
ItemGrams# Integer The weight of the item in grams.
SKU String A unique identifier of the item in the fulfillment.
VariantTitle String The title of the product variant.
Properties String Shows custom properties for this order item.
Vendor String The name of the supplier of the item.
FulFillmentsService String Service provider who is doing the fulfillment.
RequiresShipping Boolean States whether or not the fulfillment requires shipping.
Taxable Boolean States whether or not the product was taxable.
GiftCard Boolean States whether or not the order item is a gift card.
FulfillableQuantity Integer The amount available to fulfill.
TotalDiscount Double The total discount amount applied to this order item.
FulfillmentStatus String How far along an order is in terms order items fulfilled.
AppliedDiscountTitle String The title of the applied discount for this order. Only available for draft orders.
AppliedDiscountDescription String The description of the applied discount for order. Only available for draft orders.
AppliedDiscountValue Double The value of the applied discount for this order. Only available for draft orders.
AppliedDiscountValueType String The value type of the applied discount for order. Only available for draft orders.
AppliedDiscountAmount Double The amount of the applied discount for this order. Only available for draft orders.

 

Pseudo-Columns

 

 

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

 

 

   
Name Type Description
Type String The type of order item, can be one of the following(Order, DraftOrder, AbandonedCheckout).

The allowed values are Order, DraftOrder, AbandonedCheckout.

The default value is Order.

 

 

 

ProductOptions

Query product options.

 

View-Specific Information

 

The driver uses the Shopify API to process search criteria that refer to the ProductId column. The driver processes other filters client-side within the driver. For example, the following queries are processed server side.

Select
 
SELECT * FROM ProductOptions



SELECT * FROM ProductOptions WHERE ProductId='123'
You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria will cause an error.
Columns

 

 

 

   
Name Type Description
Id [KEY] String The id of the product option.
ProductId String The id of the product.
Name String The name of the product option.
Position Integer The position of the product option.
Values String The values of the product option.

 

 

 

ShippingItems

Query order shippings.

 

View-Specific Information
Select

 

The driver uses the Shopify API to process search criteria that refer to the OrderId column. The driver processes other filters client-side within the driver. For example, the following queries are processed server side.

SELECT * FROM ShippingItems



SELECT * FROM ShippingItems WHERE OrderId='123'
You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error.
Columns

 

 

 

   
Name Type Description
OrderId [KEY] String The id of the order.
Price Double The price of this shipping method.
Code String A reference to the shipping method.
Title String The title of the shipping method.
Source String The source of the shipping method.
CarrierIdentifier String A reference to the carrier service that provided the rate.
RequestedFulfillmentServiceId String A reference to the fulfillment service that is being requested for the shipping method.

 

 

 

Shop

Contains general settings and information about the shop.

 

View-Specific Information
Select

 

The driver processes the WHERE clause client-side within the driver for all queries to this table. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error. For example, the following query is the only query processed server side:

SELECT * FROM Shop
Columns

 

 

 

   
Name Type Description
Id String A unique numeric identifier for the shop.
Name String The name of the shop.
Email String The contact email address for the shop.
Address1 String The shop's street address.
Address2 String The shop's additional street address (apt, suite, etc.).
City String The city in which the shop is located.
Country String The shop's country (by default equal to the two-letter country code).
CountryCode String The two-letter country code corresponding to the shop's country.
CountryName String The shop's normalized country name.
CustomerEmail String The customer's email.
Currency String The three-letter code for the currency that the shop accepts.
Domain String The shop's domain.
GoogleAppsDomain String The URL of the domain if the shop has a google apps domain.
GoogleAppsLoginEnabled String Indicated whether the shop has google apps login enabled.
Latitude Double Geographic coordinate specifying the north/south location of a shop.
Longitude Double Geographic coordinate specifying the east/west location of a shop.
MoneyFormat String A string representing the way currency is formatted when the currency isn't specified.
MoneyWithCurrencyFormat String A string representing the way currency is formatted when the currency is specified.
WeightUnit String A string representing the default unit of weight measurement for the shop.
MyshopifyDomain String The shop's 'myshopify.com' domain.
PlanName String The name of the Shopify plan the shop is on.
HasDiscounts Boolean Indicates if any active discounts exist for the shop.
HasGiftCards Boolean Indicates if any active gift cards exist for the shop.
PlanDisplayName String The display name of the Shopify plan the shop is on.
PasswordEnabled Boolean Indicates whether the Storefront password protection is enabled.
Phone String The contact phone number for the shop.
PrimaryLocale String The shop's primary locale.
Province String The shop's normalized province or state name.
ProvinceCode String The two-letter code for the shop's province or state.
ShopOwner String The username of the shop owner.
Source String  
ForceSSL Boolean Indicates whether the shop forces requests made to its resources to be made over SSL.
TaxShipping Boolean Specifies whether or not taxes were charged for shipping.
TaxesIncluding Boolean The setting for whether applicable taxes are included in product prices.
CountryTaxes Boolean The setting for whether the shop is applying taxes on a per-county basis or not (US-only).
Timezone String The name of the timezone the shop is in.
IANATimezone String The named timezone assigned by the IANA.
Zip String The zip or postal code of the shop's address.
HasStorefront Boolean Indicates whether the shop has web-based storefront or not.
CreatedAt Datetime The date and time when the shop was created.
UpdatedAt Datetime The date and time when the shop was last updated.
SetupRequired Boolean Indicates whether the shop has any outstanding setup steps or not.

 

 

 

TaxItems

Query order taxes.

 

View-Specific Information

 

The driver uses the Shopify API to process search criteria that refer to the OrderId column. The driver processes other filters client-side within the driver. For example, the following queries are processed server side.

Select
 
SELECT * FROM TaxItems



SELECT * FROM TaxItems WHERE OrderId='123'
You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause an error.
Columns

 

 

 

   
Name Type Description
OrderId String The id of the order.
TaxItemPrice# Double The amount of tax to be charged.
TaxItemRate# Double The rate of tax to be applied.
TaxItemTitle# String The name of the tax.