<commit_before>/*
 * Copyright (c) 2007 Digital Bazaar, Inc.  All rights reserved.
 */
#include "db/database/sqlite3/Sqlite3Connection.h"
#include "db/database/sqlite3/Sqlite3Statement.h"

#include <iostream>

using namespace std;
using namespace db::database;
using namespace db::database::sqlite3;

Sqlite3Connection::Sqlite3Connection(const char* url) : Connection(url)
{
   int ret;
   mHandle = NULL;
   
   if(mUrl.getScheme() != "sqlite3")
   {
      // FIXME error handling
   }
   else
   {
      string dbFile = mUrl.getSchemeSpecificPart();
      ret = sqlite3_open(dbFile.c_str(), &mHandle);
      if(ret != SQLITE_OK)
      {
         Sqlite3Connection::close();
         // FIXME error handling
      }
   }
}

Sqlite3Connection::~Sqlite3Connection()
{
   Sqlite3Connection::close();
}

Statement* Sqlite3Connection::prepare(const char* sql)<commit_msg>Changed string comparison for url in Sqlite3Connection.<commit_after>/*
 * Copyright (c) 2007 Digital Bazaar, Inc.  All rights reserved.
 */
#include "db/database/sqlite3/Sqlite3Connection.h"
#include "db/database/sqlite3/Sqlite3Statement.h"

#include <iostream>

using namespace std;
using namespace db::database;
using namespace db::database::sqlite3;

Sqlite3Connection::Sqlite3Connection(const char* url) : Connection(url)
{
   int ret;
   mHandle = NULL;
   
   if(strcmp(mUrl.getScheme().c_str(), "sqlite3") == 0)
   {
      // FIXME error handling
   }
   else
   {
      ret = sqlite3_open(mUrl.getSchemeSpecificPart().c_str(), &mHandle);
      if(ret != SQLITE_OK)
      {
         Sqlite3Connection::close();
         // FIXME error handling
      }
   }
}

Sqlite3Connection::~Sqlite3Connection()
{
   Sqlite3Connection::close();
}

Statement* Sqlite3Connection::prepare(const char* sql)
{'fraction_non_alphanumeric': 0.12974504249291785, 'fraction_numerical': 0.02152974504249292, 'mean_word_length': 3.6968085106382977, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1457706', 'n_tokens_mistral': 590, 'n_tokens_neox': 582, 'n_words': 117}