Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7747513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:32:54+00:00 2026-06-01T10:32:54+00:00

I am an experienced programmer learning Ruby (and liking it a lot). I’m working

  • 0

I am an experienced programmer learning Ruby (and liking it a lot).
I’m working on setting up a database using SQLite3.
In order to better learn Ruby, I’m tracing into SQLite3.
What I don’t understand is, where is the code for #new for the Database and Statement classes.
Actually, I expect not a #new method, but a #initialize method.

SQLite3::Database.new(file, options = {})
SQLite3::Statement.new(db, sql)

The above two statements are from the documentation.
But in my code when I try to trace into this

$db = SQLite3::Database.new"MyDBfile"

it just steps over.

Then later on when I try to trace into

#$db.execute 

I do get into the #execute method in the Database.rb file, but then it calls the #prepare method where I try to step into

stmt = SQLite3::Statement.new( self, sql )

but again no luck. It just steps over it.

I’ve scoured the source code, done searches etc but I cannot locate the initialize methods that are being called. Where are they ?

Thank you for considering this question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:32:56+00:00Added an answer on June 1, 2026 at 10:32 am

    The initialize method for SQLite3::Database is implemented in C:

    /* call-seq: SQLite3::Database.new(file, options = {})
     *
     * Create a new Database object that opens the given file. If utf16
     * is +true+, the filename is interpreted as a UTF-16 encoded string.
     *
     * By default, the new database will return result rows as arrays
     * (#results_as_hash) and has type translation disabled (#type_translation=).
     */
    static VALUE initialize(int argc, VALUE *argv, VALUE self)
    

    Similarly for SQLite3::Statement:

    /* call-seq: SQLite3::Statement.new(db, sql)
     *
     * Create a new statement attached to the given Database instance, and which
     * encapsulates the given SQL text. If the text contains more than one
     * statement (i.e., separated by semicolons), then the #remainder property
     * will be set to the trailing text.
     */
    static VALUE initialize(VALUE self, VALUE db, VALUE sql)
    

    The Ruby debugger doesn’t know how to step into C functions (assuming the SQLite3 extensions have even been compiled with debugging support) so it skips over them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am an experienced programmer, but new to C. I am trying to learn
I'm a moderately experienced Java / C# programmer, and I've recently started learning C++.
I'm an experienced C++/.NET/Java Windows/web programmer trying to learn (Common) Lisp. I'm reading Practical
Hey everyone. I am an experienced java programmer and am just learning C++. Now
I am a pretty experienced Ruby, Objective C, and Java programmer and I was
I'm slowly learning to be a better C++ programmer and I'm currently debating the
I am a bit new to Python, but an experienced programmer. I am writing
I am an experienced C++ programmer with average Python skills. The reasons I studied
I'm an experienced Java programmer but am looking at some JavaScript/HTML5 stuff for the
I'm not an experienced C++ programmer and I'm having problems compiling. I've got a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.