1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
//! # BigQuery for Rust
//!
//! A client for Google BigQuery that uses gRPC throughout: the Storage Read API for table scans
//! and large results, the Storage Write API for inserts, and the v2 API for queries, jobs,
//! datasets and tables.
//!
//! Full documentation, with a chapter per topic: <https://bigquery-rust.abdolence.dev>
//!
//! ## Example
//!
//! ```rust,no_run
//! use bigquery::*;
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Debug, Clone, Deserialize, Serialize)]
//! struct Order {
//! id: i64,
//! customer: String,
//! total: f64,
//! }
//!
//! const SHOP: BigQueryDatasetId = BigQueryDatasetId::from_static("shop");
//! const ORDERS: BigQueryTableId = BigQueryTableId::from_static("orders");
//!
//! # async fn example() -> BigQueryResult<()> {
//! let db = BigQueryDb::new("my-project-id").await?;
//!
//! // Insert through the Storage Write API
//! let orders = vec![Order {
//! id: 1,
//! customer: "Alice".to_string(),
//! total: 120.0,
//! }];
//! db.fluent()
//! .insert()
//! .into(SHOP.table(ORDERS))
//! .objects(&orders)
//! .execute()
//! .await?;
//!
//! // Read the table back through the Storage Read API, with a typed filter
//! let large_orders: Vec<Order> = db
//! .fluent()
//! .select()
//! .from(SHOP.table(ORDERS))
//! .filter(|filter| filter.field(path!(Order::total)).gt(100.0))
//! .obj()
//! .query()
//! .await?;
//!
//! // Query with parameters
//! let alice_orders: Vec<Order> = db
//! .fluent()
//! .query("SELECT id, customer, total FROM shop.orders WHERE customer = @customer")
//! .param("customer", "Alice")
//! .obj()
//! .query()
//! .await?;
//! # let _ = (large_orders, alice_orders);
//! # Ok(())
//! # }
//! ```
/// The error types of this crate, built around [`BigQueryError`].
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
/// The `struct_path` crate the [`path!`] and [`paths!`] macros expand to, for its
/// `StructPath` derive.
pub extern crate struct_path;
/// The gcloud-sdk version this crate is built against, for [`GoogleAuthHeaders`] and the
/// raw gRPC clients.
///
/// [`GoogleAuthHeaders`]: gcloud_sdk::GoogleAuthHeaders
pub use gcloud_sdk;
pub use arrow_array;
pub use arrow_schema;
pub use jiff;
pub use url;
/// An exact instant in time, used by this library for the times BigQuery reports about a
/// dataset, a table, a job or a write: creation and last modified times, a job's start and end,
/// a table's expiration, a commit time, and a read's snapshot time.
///
/// This is an alias for [`jiff::Timestamp`]. Prefer this alias over naming `jiff::Timestamp`
/// directly, so that your code does not need an explicit `jiff` dependency and stays insulated
/// from changes of the underlying implementation.
///
/// It is not a TIMESTAMP column value: a column in your rows is a [`BigQueryTimestamp`], or a
/// plain `jiff::Timestamp`, as the type mapping describes.
///
/// ```rust
/// use bigquery::*;
///
/// let since: BigQueryInstant = "2026-10-01T00:00:00Z".parse()?;
/// let params = BigQueryListJobsParams::new().with_min_creation_time(since);
/// # let _ = params;
/// # Ok::<(), jiff::Error>(())
/// ```
pub type BigQueryInstant = Timestamp;
use crateBigQueryError;
/// The result type of every fallible call in this crate.
pub type BigQueryResult<T> = Result;