The database name for the given database. Need to parse it out of the connection string, since the JDBC does no parsing on the given connection string by default.
# File lib/sequel/adapters/jdbc/mysql.rb, line 18 18: def database_name 19: u = URI.parse(uri.sub(/\Ajdbc:/, '')) 20: (m = /\/(.*)/.match(u.path)) && m[1] 21: end
Get the last inserted id using LAST_INSERT_ID().
# File lib/sequel/adapters/jdbc/mysql.rb, line 24 24: def last_insert_id(conn, opts={}) 25: if stmt = opts[:stmt] 26: rs = stmt.getGeneratedKeys 27: begin 28: if rs.next 29: rs.getInt(1) 30: else 31: 0 32: end 33: ensure 34: rs.close 35: end 36: else 37: statement(conn) do |stmt| 38: rs = stmt.executeQuery(LAST_INSERT_ID) 39: rs.next 40: rs.getInt(1) 41: end 42: end 43: end
Convert tinyint(1) type to boolean
# File lib/sequel/adapters/jdbc/mysql.rb, line 52 52: def schema_column_type(db_type) 53: db_type == 'tinyint(1)' ? :boolean : super 54: end
Run the default connection setting SQL statements. Apply the connectiong setting SQLs for every new connection.
# File lib/sequel/adapters/jdbc/mysql.rb, line 58 58: def setup_connection(conn) 59: mysql_connection_setting_sqls.each{|sql| statement(conn){|s| log_yield(sql){s.execute(sql)}}} 60: super 61: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.