google.cloud.bigquery.query.ScalarQueryParameter¶
-
class
google.cloud.bigquery.query.
ScalarQueryParameter
(name, type_, value)[source]¶ Named / positional query parameters for scalar values.
- Parameters
name (Optional[str]) – Parameter name, used via
@foo
syntax. If None, the parameter can only be addressed via position (?
).type (str) – Name of parameter type. One of ‘STRING’, ‘INT64’, ‘FLOAT64’, ‘NUMERIC’, ‘BOOL’, ‘TIMESTAMP’, ‘DATETIME’, or ‘DATE’.
value (Union[str, int, float, decimal.Decimal, bool, datetime.datetime, datetime.date]) – The scalar parameter value.
Methods
__init__
(name, type_, value)Initialize self.
from_api_repr
(resource)Factory: construct parameter from JSON resource.
positional
(type_, value)Factory for positional paramater.
Construct JSON API representation for the parameter.
-
classmethod
from_api_repr
(resource)[source]¶ Factory: construct parameter from JSON resource.
- Parameters
resource (Dict) – JSON mapping of parameter
- Returns
Instance
- Return type
-
classmethod
positional
(type_, value)[source]¶ Factory for positional paramater.
- Parameters
type (str) – Name of parameter type. One of ‘STRING’, ‘INT64’, ‘FLOAT64’, ‘NUMERIC’, ‘BOOL’, ‘TIMESTAMP’, ‘DATETIME’, or ‘DATE’.
value (Union[str, int, float, decimal.Decimal, bool, datetime.datetime, datetime.date]) – The scalar parameter value.
- Returns
Instance without name
- Return type