duckdb 0.3.2-dev125.0 → 0.3.2-dev145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.3.2-dev125.0",
4
+ "version": "0.3.2-dev145.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -20607,6 +20607,36 @@ private:
20607
20607
  #include <sys/types.h>
20608
20608
  #include <unistd.h>
20609
20609
  #else
20610
+ //===----------------------------------------------------------------------===//
20611
+ // DuckDB
20612
+ //
20613
+ // duckdb/common/windows_util.hpp
20614
+ //
20615
+ //
20616
+ //===----------------------------------------------------------------------===//
20617
+
20618
+
20619
+
20620
+
20621
+
20622
+
20623
+
20624
+
20625
+
20626
+ namespace duckdb {
20627
+
20628
+ #ifdef DUCKDB_WINDOWS
20629
+ class WindowsUtil {
20630
+ public:
20631
+ //! Windows helper functions
20632
+ static std::wstring UTF8ToUnicode(const char *input);
20633
+ static string UnicodeToUTF8(LPCWSTR input);
20634
+ static string UTF8ToMBCS(const char *input, bool use_ansi = false);
20635
+ };
20636
+ #endif
20637
+
20638
+ } // namespace duckdb
20639
+
20610
20640
  #include <string>
20611
20641
 
20612
20642
  #ifdef __MINGW32__
@@ -21077,8 +21107,9 @@ unique_ptr<FileHandle> LocalFileSystem::OpenFile(const string &path, uint8_t fla
21077
21107
  if (flags & FileFlags::FILE_FLAGS_DIRECT_IO) {
21078
21108
  flags_and_attributes |= FILE_FLAG_NO_BUFFERING;
21079
21109
  }
21080
- HANDLE hFile =
21081
- CreateFileA(path.c_str(), desired_access, share_mode, NULL, creation_disposition, flags_and_attributes, NULL);
21110
+ auto unicode_path = WindowsUtil::UTF8ToUnicode(path.c_str());
21111
+ HANDLE hFile = CreateFileW(unicode_path.c_str(), desired_access, share_mode, NULL, creation_disposition,
21112
+ flags_and_attributes, NULL);
21082
21113
  if (hFile == INVALID_HANDLE_VALUE) {
21083
21114
  auto error = GetLastErrorAsString();
21084
21115
  throw IOException("Cannot open file \"%s\": %s", path.c_str(), error);
@@ -21228,13 +21259,18 @@ void LocalFileSystem::Truncate(FileHandle &handle, int64_t new_size) {
21228
21259
  }
21229
21260
  }
21230
21261
 
21262
+ static DWORD WindowsGetFileAttributes(const string &filename) {
21263
+ auto unicode_path = WindowsUtil::UTF8ToUnicode(filename.c_str());
21264
+ return GetFileAttributesW(unicode_path.c_str());
21265
+ }
21266
+
21231
21267
  bool LocalFileSystem::DirectoryExists(const string &directory) {
21232
- DWORD attrs = GetFileAttributesA(directory.c_str());
21268
+ DWORD attrs = WindowsGetFileAttributes(directory);
21233
21269
  return (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY));
21234
21270
  }
21235
21271
 
21236
21272
  bool LocalFileSystem::FileExists(const string &filename) {
21237
- DWORD attrs = GetFileAttributesA(filename.c_str());
21273
+ DWORD attrs = WindowsGetFileAttributes(filename);
21238
21274
  return (attrs != INVALID_FILE_ATTRIBUTES && !(attrs & FILE_ATTRIBUTE_DIRECTORY));
21239
21275
  }
21240
21276
 
@@ -21242,79 +21278,58 @@ void LocalFileSystem::CreateDirectory(const string &directory) {
21242
21278
  if (DirectoryExists(directory)) {
21243
21279
  return;
21244
21280
  }
21245
- if (directory.empty() || !CreateDirectoryA(directory.c_str(), NULL) || !DirectoryExists(directory)) {
21281
+ auto unicode_path = WindowsUtil::UTF8ToUnicode(directory.c_str());
21282
+ if (directory.empty() || !CreateDirectoryW(unicode_path.c_str(), NULL) || !DirectoryExists(directory)) {
21246
21283
  throw IOException("Could not create directory!");
21247
21284
  }
21248
21285
  }
21249
21286
 
21250
- static void delete_dir_special_snowflake_windows(FileSystem &fs, string directory) {
21251
- if (directory.size() + 3 > MAX_PATH) {
21252
- throw IOException("Pathname too long");
21253
- }
21254
- // create search pattern
21255
- TCHAR szDir[MAX_PATH];
21256
- snprintf(szDir, MAX_PATH, "%s\\*", directory.c_str());
21257
-
21258
- WIN32_FIND_DATA ffd;
21259
- HANDLE hFind = FindFirstFile(szDir, &ffd);
21260
- if (hFind == INVALID_HANDLE_VALUE) {
21261
- return;
21262
- }
21263
-
21264
- do {
21265
- if (string(ffd.cFileName) == "." || string(ffd.cFileName) == "..") {
21266
- continue;
21267
- }
21268
- if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
21269
- // recurse to zap directory contents
21270
- delete_dir_special_snowflake_windows(fs, fs.JoinPath(directory, ffd.cFileName));
21287
+ static void DeleteDirectoryRecursive(FileSystem &fs, string directory) {
21288
+ fs.ListFiles(directory, [&](const string &fname, bool is_directory) {
21289
+ if (is_directory) {
21290
+ DeleteDirectoryRecursive(fs, fs.JoinPath(directory, fname));
21271
21291
  } else {
21272
- if (strlen(ffd.cFileName) + directory.size() + 1 > MAX_PATH) {
21273
- throw IOException("Pathname too long");
21274
- }
21275
- // create search pattern
21276
- TCHAR del_path[MAX_PATH];
21277
- snprintf(del_path, MAX_PATH, "%s\\%s", directory.c_str(), ffd.cFileName);
21278
- if (!DeleteFileA(del_path)) {
21279
- throw IOException("Failed to delete directory entry");
21280
- }
21292
+ fs.RemoveFile(fs.JoinPath(directory, fname));
21281
21293
  }
21282
- } while (FindNextFile(hFind, &ffd) != 0);
21283
-
21284
- DWORD dwError = GetLastError();
21285
- if (dwError != ERROR_NO_MORE_FILES) {
21286
- throw IOException("Something went wrong");
21287
- }
21288
- FindClose(hFind);
21289
-
21290
- if (!RemoveDirectoryA(directory.c_str())) {
21294
+ });
21295
+ auto unicode_path = WindowsUtil::UTF8ToUnicode(directory.c_str());
21296
+ if (!RemoveDirectoryW(unicode_path.c_str())) {
21291
21297
  throw IOException("Failed to delete directory");
21292
21298
  }
21293
21299
  }
21294
21300
 
21295
21301
  void LocalFileSystem::RemoveDirectory(const string &directory) {
21296
- delete_dir_special_snowflake_windows(*this, directory.c_str());
21302
+ if (FileExists(directory)) {
21303
+ throw IOException("Attempting to delete directory \"%s\", but it is a file and not a directory!", directory);
21304
+ }
21305
+ if (!DirectoryExists(directory)) {
21306
+ return;
21307
+ }
21308
+ DeleteDirectoryRecursive(*this, directory.c_str());
21297
21309
  }
21298
21310
 
21299
21311
  void LocalFileSystem::RemoveFile(const string &filename) {
21300
- DeleteFileA(filename.c_str());
21312
+ auto unicode_path = WindowsUtil::UTF8ToUnicode(filename.c_str());
21313
+ DeleteFileW(unicode_path.c_str());
21301
21314
  }
21302
21315
 
21303
21316
  bool LocalFileSystem::ListFiles(const string &directory, const std::function<void(string, bool)> &callback) {
21304
21317
  string search_dir = JoinPath(directory, "*");
21305
21318
 
21306
- WIN32_FIND_DATA ffd;
21307
- HANDLE hFind = FindFirstFile(search_dir.c_str(), &ffd);
21319
+ auto unicode_path = WindowsUtil::UTF8ToUnicode(search_dir.c_str());
21320
+
21321
+ WIN32_FIND_DATAW ffd;
21322
+ HANDLE hFind = FindFirstFileW(unicode_path.c_str(), &ffd);
21308
21323
  if (hFind == INVALID_HANDLE_VALUE) {
21309
21324
  return false;
21310
21325
  }
21311
21326
  do {
21312
- string cFileName = string(ffd.cFileName);
21327
+ string cFileName = WindowsUtil::UnicodeToUTF8(ffd.cFileName);
21313
21328
  if (cFileName == "." || cFileName == "..") {
21314
21329
  continue;
21315
21330
  }
21316
21331
  callback(cFileName, ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
21317
- } while (FindNextFile(hFind, &ffd) != 0);
21332
+ } while (FindNextFileW(hFind, &ffd) != 0);
21318
21333
 
21319
21334
  DWORD dwError = GetLastError();
21320
21335
  if (dwError != ERROR_NO_MORE_FILES) {
@@ -21334,7 +21349,9 @@ void LocalFileSystem::FileSync(FileHandle &handle) {
21334
21349
  }
21335
21350
 
21336
21351
  void LocalFileSystem::MoveFile(const string &source, const string &target) {
21337
- if (!MoveFileA(source.c_str(), target.c_str())) {
21352
+ auto source_unicode = WindowsUtil::UTF8ToUnicode(source.c_str());
21353
+ auto target_unicode = WindowsUtil::UTF8ToUnicode(target.c_str());
21354
+ if (!MoveFileW(source_unicode.c_str(), target_unicode.c_str())) {
21338
21355
  throw IOException("Could not move file");
21339
21356
  }
21340
21357
  }
@@ -21345,7 +21362,7 @@ FileType LocalFileSystem::GetFileType(FileHandle &handle) {
21345
21362
  if (strncmp(path.c_str(), PIPE_PREFIX, strlen(PIPE_PREFIX)) == 0) {
21346
21363
  return FileType::FILE_TYPE_FIFO;
21347
21364
  }
21348
- DWORD attrs = GetFileAttributesA(path.c_str());
21365
+ DWORD attrs = WindowsGetFileAttributes(path.c_str());
21349
21366
  if (attrs != INVALID_FILE_ATTRIBUTES) {
21350
21367
  if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
21351
21368
  return FileType::FILE_TYPE_DIR;
@@ -26256,13 +26273,29 @@ unique_ptr<FileHandle> PipeFileSystem::OpenPipe(unique_ptr<FileHandle> handle) {
26256
26273
  } // namespace duckdb
26257
26274
 
26258
26275
 
26276
+
26277
+
26259
26278
  #include <stdio.h>
26260
26279
 
26280
+ #ifndef DUCKDB_DISABLE_PRINT
26281
+ #ifdef DUCKDB_WINDOWS
26282
+ #include <io.h>
26283
+ #endif
26284
+ #endif
26285
+
26261
26286
  namespace duckdb {
26262
26287
 
26263
26288
  // LCOV_EXCL_START
26264
26289
  void Printer::Print(const string &str) {
26265
26290
  #ifndef DUCKDB_DISABLE_PRINT
26291
+ #ifdef DUCKDB_WINDOWS
26292
+ if (IsTerminal()) {
26293
+ // print utf8 to terminal
26294
+ auto unicode = WindowsUtil::UTF8ToMBCS(str.c_str());
26295
+ fprintf(stderr, "%s\n", unicode.c_str());
26296
+ return;
26297
+ }
26298
+ #endif
26266
26299
  fprintf(stderr, "%s\n", str.c_str());
26267
26300
  #endif
26268
26301
  }
@@ -26283,6 +26316,17 @@ void Printer::FinishProgressBarPrint(const char *pbstr, int pbwidth) {
26283
26316
  fflush(stdout);
26284
26317
  #endif
26285
26318
  }
26319
+
26320
+ bool Printer::IsTerminal() {
26321
+ #ifndef DUCKDB_DISABLE_PRINT
26322
+ #ifdef DUCKDB_WINDOWS
26323
+ return GetFileType(stderr) == FILE_TYPE_CHAR;
26324
+ #else
26325
+ throw InternalException("IsTerminal is only implemented for Windows");
26326
+ #endif
26327
+ #endif
26328
+ return false;
26329
+ }
26286
26330
  // LCOV_EXCL_STOP
26287
26331
 
26288
26332
  } // namespace duckdb
@@ -32284,19 +32328,19 @@ struct TreeRendererConfig {
32284
32328
  bool detailed = false;
32285
32329
 
32286
32330
  #ifndef DUCKDB_ASCII_TREE_RENDERER
32287
- const char *LTCORNER = "┌";
32288
- const char *RTCORNER = "┐";
32289
- const char *LDCORNER = "└";
32290
- const char *RDCORNER = "┘";
32291
-
32292
- const char *MIDDLE = "┼";
32293
- const char *TMIDDLE = "┬";
32294
- const char *LMIDDLE = "├";
32295
- const char *RMIDDLE = "┤";
32296
- const char *DMIDDLE = "┴";
32297
-
32298
- const char *VERTICAL = "│";
32299
- const char *HORIZONTAL = "─";
32331
+ const char *LTCORNER = "\342\224\214"; // "┌";
32332
+ const char *RTCORNER = "\342\224\220"; // "┐";
32333
+ const char *LDCORNER = "\342\224\224"; // "└";
32334
+ const char *RDCORNER = "\342\224\230"; // "┘";
32335
+
32336
+ const char *MIDDLE = "\342\224\274"; // "┼";
32337
+ const char *TMIDDLE = "\342\224\254"; // "┬";
32338
+ const char *LMIDDLE = "\342\224\234"; // "├";
32339
+ const char *RMIDDLE = "\342\224\244"; // "┤";
32340
+ const char *DMIDDLE = "\342\224\264"; // "┴";
32341
+
32342
+ const char *VERTICAL = "\342\224\202"; // "│";
32343
+ const char *HORIZONTAL = "\342\224\200"; // "─";
32300
32344
  #else
32301
32345
  // ASCII version
32302
32346
  const char *LTCORNER = "<";
@@ -47350,6 +47394,59 @@ unique_ptr<FileHandle> VirtualFileSystem::OpenFile(const string &path, uint8_t f
47350
47394
  } // namespace duckdb
47351
47395
 
47352
47396
 
47397
+ namespace duckdb {
47398
+
47399
+ #ifdef DUCKDB_WINDOWS
47400
+
47401
+ std::wstring WindowsUtil::UTF8ToUnicode(const char *input) {
47402
+ idx_t result_size;
47403
+
47404
+ result_size = MultiByteToWideChar(CP_UTF8, 0, input, -1, nullptr, 0);
47405
+ if (result_size == 0) {
47406
+ throw IOException("Failure in MultiByteToWideChar");
47407
+ }
47408
+ auto buffer = unique_ptr<wchar_t[]>(new wchar_t[result_size]);
47409
+ result_size = MultiByteToWideChar(CP_UTF8, 0, input, -1, buffer.get(), result_size);
47410
+ if (result_size == 0) {
47411
+ throw IOException("Failure in MultiByteToWideChar");
47412
+ }
47413
+ return std::wstring(buffer.get(), result_size);
47414
+ }
47415
+
47416
+ static string WideCharToMultiByteWrapper(LPCWSTR input, uint32_t code_page) {
47417
+ idx_t result_size;
47418
+
47419
+ result_size = WideCharToMultiByte(code_page, 0, input, -1, 0, 0, 0, 0);
47420
+ if (result_size == 0) {
47421
+ throw IOException("Failure in WideCharToMultiByte");
47422
+ }
47423
+ auto buffer = unique_ptr<char[]>(new char[result_size]);
47424
+ result_size = WideCharToMultiByte(code_page, 0, input, -1, buffer.get(), result_size, 0, 0);
47425
+ if (result_size == 0) {
47426
+ throw IOException("Failure in WideCharToMultiByte");
47427
+ }
47428
+ return string(buffer.get(), result_size - 1);
47429
+ }
47430
+
47431
+ string WindowsUtil::UnicodeToUTF8(LPCWSTR input) {
47432
+ return WideCharToMultiByteWrapper(input, CP_UTF8);
47433
+ }
47434
+
47435
+ static string WindowsUnicodeToMBCS(LPCWSTR unicode_text, int use_ansi) {
47436
+ uint32_t code_page = use_ansi ? CP_ACP : CP_OEMCP;
47437
+ return WideCharToMultiByteWrapper(unicode_text, code_page);
47438
+ }
47439
+
47440
+ string WindowsUtil::UTF8ToMBCS(const char *input, bool use_ansi) {
47441
+ auto unicode = WindowsUtil::UTF8ToUnicode(input);
47442
+ return WindowsUnicodeToMBCS(unicode.c_str(), use_ansi);
47443
+ }
47444
+
47445
+ #endif
47446
+
47447
+ } // namespace duckdb
47448
+
47449
+
47353
47450
  //===----------------------------------------------------------------------===//
47354
47451
  // DuckDB
47355
47452
  //
@@ -145916,7 +146013,7 @@ vector<ColumnBinding> LogicalOperator::MapBindings(const vector<ColumnBinding> &
145916
146013
  }
145917
146014
  }
145918
146015
 
145919
- string LogicalOperator::ToString(idx_t depth) const {
146016
+ string LogicalOperator::ToString() const {
145920
146017
  TreeRenderer renderer;
145921
146018
  return renderer.ToString(*this);
145922
146019
  }
@@ -242585,7 +242682,7 @@ namespace duckdb_libpgquery {
242585
242682
  #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
242586
242683
 
242587
242684
  /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
242588
- * if you want the limit (max/min) macros for int types.
242685
+ * if you want the limit (max/min) macros for int types.
242589
242686
  */
242590
242687
  #ifndef __STDC_LIMIT_MACROS
242591
242688
  #define __STDC_LIMIT_MACROS 1
@@ -242603,7 +242700,7 @@ typedef uint64_t flex_uint64_t;
242603
242700
  typedef signed char flex_int8_t;
242604
242701
  typedef short int flex_int16_t;
242605
242702
  typedef int flex_int32_t;
242606
- typedef unsigned char flex_uint8_t;
242703
+ typedef unsigned char flex_uint8_t;
242607
242704
  typedef unsigned short int flex_uint16_t;
242608
242705
  typedef unsigned int flex_uint32_t;
242609
242706
 
@@ -242727,10 +242824,10 @@ typedef size_t yy_size_t;
242727
242824
  #define EOB_ACT_CONTINUE_SCAN 0
242728
242825
  #define EOB_ACT_END_OF_FILE 1
242729
242826
  #define EOB_ACT_LAST_MATCH 2
242730
-
242827
+
242731
242828
  #define YY_LESS_LINENO(n)
242732
242829
  #define YY_LINENO_REWIND_TO(ptr)
242733
-
242830
+
242734
242831
  /* Return all but the first "n" matched characters back to the input stream. */
242735
242832
  #define yyless(n) \
242736
242833
  do \
@@ -243640,9 +243737,9 @@ static int yy_init_globals ( yyscan_t yyscanner );
243640
243737
  /* This must go here because YYSTYPE and YYLTYPE are included
243641
243738
  * from bison output in section 1.*/
243642
243739
  # define yylval yyg->yylval_r
243643
-
243740
+
243644
243741
  # define yylloc yyg->yylloc_r
243645
-
243742
+
243646
243743
  int yylex_init (yyscan_t* scanner);
243647
243744
 
243648
243745
  int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
@@ -243685,9 +243782,9 @@ YYSTYPE * yyget_lval ( yyscan_t yyscanner );
243685
243782
  void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
243686
243783
 
243687
243784
  YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
243688
-
243785
+
243689
243786
  void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
243690
-
243787
+
243691
243788
  /* Macros after this point can all be overridden by user definitions in
243692
243789
  * section 1.
243693
243790
  */
@@ -243701,7 +243798,7 @@ extern int yywrap ( yyscan_t yyscanner );
243701
243798
  #endif
243702
243799
 
243703
243800
  #ifndef YY_NO_UNPUT
243704
-
243801
+
243705
243802
  #endif
243706
243803
 
243707
243804
  #ifndef yytext_ptr
@@ -245399,7 +245496,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner)
245399
245496
  YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
245400
245497
  {
245401
245498
  YY_BUFFER_STATE b;
245402
-
245499
+
245403
245500
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
245404
245501
  if ( ! b )
245405
245502
  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
@@ -245465,7 +245562,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner)
245465
245562
  }
245466
245563
 
245467
245564
  b->yy_is_interactive = 0;
245468
-
245565
+
245469
245566
  errno = oerrno;
245470
245567
  }
245471
245568
 
@@ -245607,7 +245704,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
245607
245704
  YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
245608
245705
  {
245609
245706
  YY_BUFFER_STATE b;
245610
-
245707
+
245611
245708
  if ( size < 2 ||
245612
245709
  base[size-2] != YY_END_OF_BUFFER_CHAR ||
245613
245710
  base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -245643,7 +245740,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann
245643
245740
  */
245644
245741
  YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
245645
245742
  {
245646
-
245743
+
245647
245744
  return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
245648
245745
  }
245649
245746
 
@@ -245660,7 +245757,7 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, yy_size_t _yybytes_len ,
245660
245757
  char *buf;
245661
245758
  yy_size_t n;
245662
245759
  yy_size_t i;
245663
-
245760
+
245664
245761
  /* Get memory for full buffer, including space for trailing EOB's. */
245665
245762
  n = (yy_size_t) (_yybytes_len + 2);
245666
245763
  buf = (char *) yyalloc( n , yyscanner );
@@ -245692,7 +245789,6 @@ static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
245692
245789
  {
245693
245790
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
245694
245791
  (void)yyg;
245695
- fprintf( stderr, "%s\n", msg );
245696
245792
  throw std::runtime_error(msg); // YY_EXIT_FAILURE );
245697
245793
  }
245698
245794
 
@@ -245733,7 +245829,7 @@ int yyget_lineno (yyscan_t yyscanner)
245733
245829
 
245734
245830
  if (! YY_CURRENT_BUFFER)
245735
245831
  return 0;
245736
-
245832
+
245737
245833
  return yylineno;
245738
245834
  }
245739
245835
 
@@ -245746,7 +245842,7 @@ int yyget_column (yyscan_t yyscanner)
245746
245842
 
245747
245843
  if (! YY_CURRENT_BUFFER)
245748
245844
  return 0;
245749
-
245845
+
245750
245846
  return yycolumn;
245751
245847
  }
245752
245848
 
@@ -245808,7 +245904,7 @@ void yyset_lineno (int _line_number , yyscan_t yyscanner)
245808
245904
  /* lineno is only valid if an input buffer exists. */
245809
245905
  if (! YY_CURRENT_BUFFER )
245810
245906
  YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
245811
-
245907
+
245812
245908
  yylineno = _line_number;
245813
245909
  }
245814
245910
 
@@ -245823,7 +245919,7 @@ void yyset_column (int _column_no , yyscan_t yyscanner)
245823
245919
  /* column is only valid if an input buffer exists. */
245824
245920
  if (! YY_CURRENT_BUFFER )
245825
245921
  YY_FATAL_ERROR( "yyset_column called with no buffer" );
245826
-
245922
+
245827
245923
  yycolumn = _column_no;
245828
245924
  }
245829
245925
 
@@ -245876,13 +245972,13 @@ YYLTYPE *yyget_lloc (yyscan_t yyscanner)
245876
245972
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
245877
245973
  return yylloc;
245878
245974
  }
245879
-
245975
+
245880
245976
  void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
245881
245977
  {
245882
245978
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
245883
245979
  yylloc = yylloc_param;
245884
245980
  }
245885
-
245981
+
245886
245982
  /* User-visible API */
245887
245983
 
245888
245984
  /* yylex_init is special because it creates the scanner itself, so it is
@@ -245962,13 +246058,8 @@ static int yy_init_globals (yyscan_t yyscanner)
245962
246058
  yyg->yy_start_stack = NULL;
245963
246059
 
245964
246060
  /* Defined in main.c */
245965
- #ifdef YY_STDINIT
245966
- yyin = stdin;
245967
- yyout = stdout;
245968
- #else
245969
246061
  yyin = NULL;
245970
246062
  yyout = NULL;
245971
- #endif
245972
246063
 
245973
246064
  /* For future reference: Set errno on error, since we are called by
245974
246065
  * yylex_init()
package/src/duckdb.hpp CHANGED
@@ -10,8 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
10
10
 
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
- #define DUCKDB_SOURCE_ID "a13ec3642"
14
- #define DUCKDB_VERSION "0.3.2-dev125"
13
+ #define DUCKDB_SOURCE_ID "1f9b8f4d6"
14
+ #define DUCKDB_VERSION "0.3.2-dev145"
15
15
  //===----------------------------------------------------------------------===//
16
16
  // DuckDB
17
17
  //
@@ -198,6 +198,12 @@ enum class ProfilerPrintFormat : uint8_t { NONE, QUERY_TREE, JSON, QUERY_TREE_OP
198
198
  #define suint64_t int64_t
199
199
  #endif
200
200
 
201
+ #if defined(_WIN32) || defined(_WIN64)
202
+ #define DUCKDB_WINDOWS
203
+ #elif defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))
204
+ #define DUCKDB_POSIX
205
+ #endif
206
+
201
207
  namespace duckdb {
202
208
  #if !defined(_MSC_VER) && (__cplusplus < 201402L)
203
209
  template <typename T, typename... Args>
@@ -7983,7 +7989,7 @@ public:
7983
7989
 
7984
7990
  virtual string GetName() const;
7985
7991
  virtual string ParamsToString() const;
7986
- virtual string ToString(idx_t depth = 0) const;
7992
+ virtual string ToString() const;
7987
7993
  void Print();
7988
7994
  //! Debug method: verify that the integrity of expressions & child nodes are maintained
7989
7995
  virtual void Verify();
@@ -9470,6 +9476,8 @@ public:
9470
9476
  static void PrintProgress(int percentage, const char *pbstr, int pbwidth);
9471
9477
  //! Prints an empty line when progress bar is done
9472
9478
  static void FinishProgressBarPrint(const char *pbstr, int pbwidth);
9479
+ //! Whether or not we are printing to a terminal
9480
+ static bool IsTerminal();
9473
9481
  };
9474
9482
  } // namespace duckdb
9475
9483