TDV Adapter for WordPress

Build 22.0.8462

Comments

Create, update, delete, and query Comments associated with a post.

Table Specific Information

Select

The adapter uses the WordPress API to process supported filters. The adapter processes other filters client-side within the adapter. 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 inconsistent data. For example, the following queries are processed server side.

SELECT * FROM Comments WHERE Id = 61
SELECT * FROM Comments WHERE Id IN (61, 45)
SELECT * FROM Comments WHERE AuthorEmail = 'authoremail@gmail.com' AND Status = 'approve' AND Type = 'comment' AND PostId = '1'
SELECT * FROM Comments WHERE Author IN ('1','2')
SELECT * FROM Comments WHERE Date > '2018-02-02T02:02:23'
SELECT * FROM Comments WHERE Date < '2018-02-02T02:02:23'
SELECT * FROM Comments Order By Date DESC
Also, ordering by Id, DateGMT, Type, Parent, is handled by the WordPress API.

Insert

To insert comments you must specify the following columns: PostId, Content.

INSERT INTO Comments (PostId, Content) VALUES ('1', 'This is a comment in the post with id 1.')

Update

To update a comment you must specify the following column: Id
Update Comments SET Content='Updated content' WHERE Id='1234'
Other fields that you can use on Insert / Update queries are: Author, AuthorEmail, AuthorIp, AuthorName, AuthorUrl, Content, Date, DateGMT, Parent, PostId, Status.

Delete

To delete a Comment you must specify the following column: Id.

DELETE FROM Comments WHERE Id = '1234'

Columns

Name Type ReadOnly Description
Id [KEY] Integer True

Unique identifier for the object.

Author Integer False

The ID of the user object, if author was a user.

AuthorEmail String False

Email address for the object author.

AuthorIp String False

IP address for the object author.

AuthorName String False

Display name for the object author.

AuthorUrl String False

URL for the object author.

Date Datetime False

The date the object was published.

DateGMT Datetime False

The date the object was published as GMT.

Status String False

State of the object.

Type String True

Type of Comment for the object.

Parent Integer False

The ID for the parent of the object.

Content String False

The content for the object.

PostId Integer False

The ID of the associated post object.

Link String True

URL to the object.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462