added :datetime support
fixed tables method
connection management