MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_attr

Method parse_attr

nodedb-sql/src/parser/array_stmt/parse_impl.rs:257–274  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

255 }
256
257 fn parse_attr(&mut self) -> Result<ArrayAttrAst> {
258 let name = self.expect_ident()?;
259 let type_name = self.expect_ident()?;
260 let dtype = parse_attr_type(&type_name)
261 .ok_or_else(|| self.err(format!("unknown attr type `{type_name}`")))?;
262 let nullable = if self.match_kw("NOT") {
263 self.expect_kw("NULL")?;
264 false
265 } else {
266 // Default: nullable.
267 true
268 };
269 Ok(ArrayAttrAst {
270 name,
271 dtype,
272 nullable,
273 })
274 }
275
276 fn parse_cell_order(&mut self) -> Result<ArrayCellOrderAst> {
277 let id = self.expect_ident()?;

Callers 1

parse_createMethod · 0.80

Calls 5

parse_attr_typeFunction · 0.85
expect_identMethod · 0.80
match_kwMethod · 0.80
expect_kwMethod · 0.80
errMethod · 0.45

Tested by

no test coverage detected