sqlite work

only set PDO attrributes if a connection has actually been established.