pub fn new_predicate(&self, pred: &Predicate) -> Result<()> {
        // The predicate name is used as a table name, check it for legality
        if !valid_name(&pred.name) {
            bail!(ErrorKind::Arg(
                "Invalid name: Use lowercase and \
                                 underscores only"
                    .to_string(),
            ));
        }
        // If this predicate was already registered, check for a match
        match self.pred_by_name.borrow().get(&pred.name) {
            Some(existing) => {
                if existing != pred {
                    bail!(ErrorKind::Arg(format!(
                        "Predicate {} already registered at a \
                                                  different type.\nExisting: {:?}\nNew: {:?}",
                        &pred.name,
                        existing,
                        pred
                    )));
                } else {
                    return Ok(());
                }
            }
            None => (),
        }

        try!(self.insert_predicate(&pred));
        self.gen_insert_stmt(&pred);
        self.pred_by_name.borrow_mut().insert(
            pred.name.clone(),
            pred.clone(),
        );
        Ok(())
    }
/// Persists a predicate by name
/// The name *must* consist only of lower case ASCII and _, anything else
/// will be rejected. This restriction is because the predicate name is
/// currently used to construct the table name.
///
/// In the future, this restriction could be lifted by generating table
/// names rather than using the names of predicates, but this helps a lot
/// with debugging for now.
// TODO lift restriction on predicate names
Persists a predicate by name
The name *must* consist only of lower case ASCII and _, anything else
will be rejected. This restriction is because the predicate name is
currently used to construct the table name.

In the future, this restriction could be lifted by generating table
names rather than using the names of predicates, but this helps a lot
with debugging for now.
TODO lift restriction on predicate names
Persists a predicate by name The name * must * consist only of lower case ASCII and _ anything else will be rejected . This restriction is because the predicate name is currently used to construct the table name . In the future this restriction could be lifted by generating table names rather than using the names of predicates but this helps a lot with debugging for now . TODO lift restriction on predicate names
pub fn new_predicate(&self, pred: &Predicate) -> Result<()> {
        // The predicate name is used as a table name, check it for legality
        if !valid_name(&pred.name) {
            bail!(ErrorKind::Arg(
                "Invalid name: Use lowercase and \
                                 underscores only"
                    .to_string(),
            ));
        }
        // If this predicate was already registered, check for a match
        match self.pred_by_name.borrow().get(&pred.name) {
            Some(existing) => {
                if existing != pred {
                    bail!(ErrorKind::Arg(format!(
                        "Predicate {} already registered at a \
                                                  different type.\nExisting: {:?}\nNew: {:?}",
                        &pred.name,
                        existing,
                        pred
                    )));
                } else {
                    return Ok(());
                }
            }
            None => (),
        }
        try!(self.insert_predicate(&pred));
        self.gen_insert_stmt(&pred);
        self.pred_by_name.borrow_mut().insert(
            pred.name.clone(),
            pred.clone(),
        );
        Ok(())
    }
pub fn new_predicate ( & self , pred : & Predicate ) -> Result < ( ) > { // The predicate name is used as a table name, check it for legality if ! valid_name ( & pred . name ) { bail ! ( ErrorKind Arg ( " \
 " to_string ( ) ) ) ; } // If this predicate was already registered, check for a match match self . pred_by_name . borrow ( ) . get ( & pred . name ) { Some ( existing ) => { if existing != pred { bail ! ( ErrorKind Arg ( format ( " \
 \n \n " pred name existing pred ) ) ) ; } else { return Ok ( ( ) ) ; } } None => ( ) , } try ! ( self insert_predicate ( pred ) ) ; self . gen_insert_stmt ( & pred ) ; self . pred_by_name . borrow_mut ( ) . insert ( pred . name . clone ( ) , pred . clone ( ) , ) ; Ok ( ( ) ) }
Persists a predicate by name
The name *must* consist only of lower case ASCII and _, anything else
will be rejected.
Persists a predicate by name The name * must * consist only of lower case ASCII and _ anything else will be rejected .
&self
pred
&Predicate
&self
pred
&Predicate