Skip to main content
Module

x/soda/mod.ts>SelectImpl

SODA (Socrata) Client for Deno/Node
Latest
class SelectImpl
import { SelectImpl } from "https://deno.land/x/soda@0.4.5/mod.ts";

SelectImpl is used to build a select query

Note: This is an internal class and should not be used directly

Constructors

new
SelectImpl(field?: string | FieldImpl)

Properties

private
asField: string | null
private
extraField: string | null
private
field: string | null
private
fieldObj: FieldImpl | null
private
func: SelectFunction
readonly
fieldName: string
readonly
value: string

Methods

private
dateExtract(funcName: string, func: SelectFunction): SelectImpl<DataType.FloatingTimestamp>
abs(): SelectImpl<DataType.Number>

Works on fields of type Number

as(as: string): SelectImpl<T>
avg(): SelectImpl<DataType.Number>

Works on fields of type Number

Docs: https://dev.socrata.com/docs/functions/avg.html

convexHull(): SelectImpl<
| DataType.Point
| DataType.MultiPoint
| DataType.Line
| DataType.MultiLine
| DataType.Polygon
| DataType.MultiPolygon
>

Works on fields of type Point/MultiPoint/Line/MultiLine/Polygon/MultiPolygon

Returns the minimum convex geometry that encloses all of another geometry's points.

Docs: https://dev.socrata.com/docs/functions/convex_hull.html

dateExtractDayOfDate(): SelectImpl<DataType.FloatingTimestamp>

Extracts the day from the date as an integer.

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_extract_d.html

dateExtractDayOfWeek(): SelectImpl<DataType.FloatingTimestamp>

Extracts the day of the week as an integer between 0 and 6 (inclusive).

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_extract_dow.html

dateExtractHourOfDay(): SelectImpl<DataType.FloatingTimestamp>

Extracts the hour of the day as an integer between 0 and 23 (inclusive).

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_extract_hh.html

dateExtractMinute(): SelectImpl<DataType.FloatingTimestamp>

Extracts the minute from the time as an integer.

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_extract_mm.html

dateExtractMonth(): SelectImpl<DataType.FloatingTimestamp>

Extracts the month as an integer.

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_extract_m.html

dateExtractSeconds(): SelectImpl<DataType.FloatingTimestamp>

Extracts the second from the time as an integer.

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_extract_ss.html

dateExtractWeekOfYear(): SelectImpl<DataType.FloatingTimestamp>

Extracts the week of the year as an integer between 0 and 51 (inclusive).

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_extract_woy.html

dateExtractYear(): SelectImpl<DataType.FloatingTimestamp>

Extracts the year as an integer.

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_extract_y.html

dateTruncYear(): SelectImpl<DataType.FloatingTimestamp>

Truncates a calendar date at the year threshold

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_trunc_y.html

dateTruncYearMonth(): SelectImpl<DataType.FloatingTimestamp>

Truncates a calendar date at the year/month threshold

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_trunc_ym.html

dateTruncYearMonthDay(): SelectImpl<DataType.FloatingTimestamp>

Truncates a calendar date at the year/month/date threshold

Works on fields of type Floating Timestamp

Docs: https://dev.socrata.com/docs/functions/date_trunc_ymd.html

distanceInMeters(lat: number, lon: number): SelectImpl<DataType.Point>
extent(): SelectImpl<
| DataType.Point
| DataType.MultiPoint
| DataType.Line
| DataType.MultiLine
| DataType.Polygon
| DataType.MultiPolygon
>

Returns a bounding box that encloses a set of geometries

Works on fields of type Point, MultiPoint, Line, MultiLine, Polygon, MultiPolygon

Docs: https://dev.socrata.com/docs/functions/extent.html

length(): SelectImpl<DataType.Text>

Works on fields of type Text

lowerCase(): SelectImpl<DataType.Text>

Works on fields of type Text

max(): SelectImpl<
| DataType.Number
| DataType.Text
| DataType.FloatingTimestamp
| DataType.FixedTimestamp
>

Returns the maximum of a given set of numbers

Works on fields of type Number/Text/FloatingTimestamp/FixedTimestamp

Docs: https://dev.socrata.com/docs/functions/max.html

min(): SelectImpl<
| DataType.Number
| DataType.Text
| DataType.FloatingTimestamp
| DataType.FixedTimestamp
>

Returns the minimum of a given set of numbers

Works on fields of type Number/Text/FloatingTimestamp/FixedTimestamp

Docs: https://dev.socrata.com/docs/functions/min.html

numberOfVertices(): SelectImpl<
| DataType.Polygon
| DataType.Line
| DataType.Point
| DataType.MultiPoint
| DataType.MultiLine
| DataType.MultiPolygon
>

Returns the number of vertices in a geospatial data record

Works on fields of type Polygon, Line, Point, MultiPoint, MultiLine, MultiPolygon

Docs: https://dev.socrata.com/docs/functions/num_points.html

pad(
length: number,
pad: string,
type: "LEFT" | "RIGHT",
): SelectImpl<DataType.Text>
setFunc(func: SelectFunction, extraField?: string): SelectImpl<T>
simplify(tolerance: number): SelectImpl<
| DataType.Line
| DataType.MultiLine
| DataType.Polygon
| DataType.MultiPolygon
>

Reduces the number of vertices in a line or polygon

simplifyPreserveTopology(tolerance: number): SelectImpl<
| DataType.Line
| DataType.MultiLine
| DataType.Polygon
| DataType.MultiPolygon
>

Reduces the number of vertices in a line or polygon, preserving topology

sum(): SelectImpl<DataType.Number>

Works on fields of type Number

Docs: https://dev.socrata.com/docs/functions/sum.html

toString(): string
upperCase(): SelectImpl<DataType.Text>

Works on fields of type Text