Database-BI

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	  /join or /combine: /combine ignored j=, and Merge after Combine
	  dropped c=.  The table now shows the rows its charts draw from.
	- Tests: the read-only model_dir and export-write-failure tests skip
	  where chmod cannot revoke access (Cygwin, Windows ACLs, root), using
	  Test::Permissions; they failed on Cygwin (CPAN Testers).
	  Fixes https://www.cpantesters.org/cpan/report/b2c11820-d297-11f1-a488-efeb21b3859a
	- Tests: t/unit.t no longer segfaults at exit under Devel::Cover on
	  perl 5.42 (the CI coverage step); its LLM-response helper was a
	  lexical "my sub".
	- Text::CSV is a prerequisite: script/bi-alert's fallback reader needed
	  it and it was not declared.
	- Documentation: cross-row columns (cs=, by=, order=), compression and the
	  page cache (page_cache_dir, page_cache_duration), breadcrumbs and 404
	  pages, j= with c= on /join and /combine, and an API SPECIFICATION for
	  every public function.  Util.pm's licence now matches the
	  distribution's (GPL2).  Fixed POD that rendered "= >" and "&>".
	- The templates and controller comments are ASCII again.

0.017.1	Sun Oct 25 09:23:34 PM EDT 2026
	[ Bug Fixes ]
	- script/database-bi: shebang is perl again; the script starts morbo
	  itself when given no arguments.  0.017.0's morbo shebang caused each
	  worker to spawn another morbo, growing PERL5LIB until exec failed with
	  E2BIG.
	- GET /map: HTML::OSM older than 0.12 now produces a warning page instead
	  of a 500.  0.017.0 passed search => 0 and max_zoom unconditionally;
	  older HTML::OSM rejected the unknown keys.
	- GET /map: ?agg= removed (it was accepted and ignored).
	- /join: schema-type mismatch warnings now fire correctly.  DataSource
	  delegates schema() to its inner backend; the controller compares types
	  across join steps and reports differing columns.
	- data_dir may be absolute.  A relative value is still resolved against
	  the application home; an absolute one was previously appended to it.
	- Database::BI::Extract: removed unused _get_or_build_extract; corrected
	  class docs (the web app does not materialise extracts).
	- script/bi-alert: corrected docs -- it writes to STDOUT, not email.
	  --dry-run is accepted for compatibility only.
	- Parallel test runs (HARNESS_OPTIONS=j10) are now deterministic.  Upload
	  staging moved to a per-deployment uploads_dir config key (.uploads by
	  default); test files each use their own temp directory.
	- Browser fixture: selector quoting no longer depends on the JSON
	  backend's allow_nonref setting.
	- t/integration.t: %INC restored after Test::Without::Module block,
	  eliminating "Subroutine ... redefined" noise.
	- Every page now sets <html lang> from the resolved language.  36 render
	  calls were missing the stash key.
	- Geo::Coder::Free minimum raised to 0.48 throughout (floor constant,
	  error messages, docs).  The floor was 0.47, but 0.48 introduced the
	  per-lookup read counts the application uses.
	- _resolve_language now falls back to the default language when the
	  resolved code has no template directory, as documented.
	[ New Features ]
	- GET /map: ?size=<col> draws bubble markers scaled 6-30 px.
	- GET /map: ?series=<col>&scheme=<name> colours markers by category with
	  a legend.  Mutually exclusive with ?color=.
	[ Documentation ]
	- Complete /map parameter reference; HTML::OSM 0.12 floor;
	  Nominatim search always suppressed.
	- "Command-line tools" section covering all three scripts.
	- Canvas, analyses API, sharing/embedding, catalog, insights, ask,
	  summary and geo endpoints (previously README-only).
	[ Tests ]
	- t/launcher.t: asserts perl shebang on every shipped script.
	- t/map.t and t/integration.t: drive both renderer states via the
	  controller's _map_renderer_version probe.
	- t/edge_cases.t: covers uploads_dir resolution (absolute, relative, unset).
	- t/map.t: covers the canvas in both renderer states.
	- Every test file now gives the app its own model_dir temp directory.
	- t/browser-canvas-map-degraded.t: browser test for the degraded map card.
	- Map-rendering assertions in t/map.t, t/integration.t and t/unit.t now
	  require HTML::OSM 0.12 (not merely installed).
	- browser.yml: no-renderer, no-renderer-canvas, no-geocoder and renderer
	  jobs added; each pins or verifies one optional module.
	- BI::Test::Browser: config keys written before app startup; fixture
	  builds a language home for non-shipped locales; app_setup coderef
	  supported.
	- t/browser-fixture.t: checks fixture behaviour without a browser.
	- t/browser-map-page-renderer.t, t/browser-map-geocoder.t,
	  t/browser-canvas-map-geocoder.t: browser coverage for optional-module
	  degraded states.
	- t/browser-offline-assets.t: skips map assertions below HTML::OSM 0.12;
	  adds D3-drawn bar assertions.
	- t/recommended-versions.t: asserts tests and application code gate
	  recommended modules at the declared version floor.
	- t/browser-language.t: browser coverage for configured, default and
	  fallback languages.
	- .github/workflows/actionlint.yml: lints all workflows on push/PR
	  (pinned actionlint 1.7.12 + shellcheck 0.10.0); fixed 24 shellcheck
	  findings in existing workflows.
	- browser.yml: keyboard job handles missing HTML::OSM without failing;
	  browser-map-panel.t no longer dies when a card has no script.
	- Every browser job publishes a coverage report to the job summary.
	- t/workflow-browser.t: guards the renderer job's file list.

0.017.0	Sat Oct 24 06:12:53 PM EDT 2026
	[ New Features ]
	- GET /geo/list, POST /geo/save, POST /geo/delete: coordinate-column
	  preference CRUD.  Saves the user's choice of lat=, lon=, or loc=
	  column for a given l= spec in .bi/models.json under geo.<spec>.columns.
	  The Map panel now fetches /geo/list on open and pre-populates the
	  column selects from the saved preferences, falling back to the existing
	  name-heuristic when none are saved.  A "Remember columns" checkbox
	  fires POST /geo/save on form submit.
	- GET /map: new optional URL params.
	  ?zoom=N (0-19): passes an initial zoom level to HTML::OSM instead of
	    auto-fitting to the marker bounds.
	  ?tiles=name: selects a named tile source from the tile_sources config
	    key (unknown name returns 400).  Arbitrary URLs are never accepted.
	  ?heat=1: adds a Leaflet heatmap layer over the regular markers using
	    HTML::OSM->add_heatmap (present in HTML::OSM >= 0.11).
	  ?weight=<col>: numeric column that drives heatmap point intensity;
	    values are normalised to [0,1]; defaults to equal weight 1 when
	    absent.
	  ?max_zoom=N (0-28): sets the Leaflet tile layer maxZoom option so the
	    user cannot zoom past what the tile server covers.  Also readable
	    from the map_max_zoom config key; the URL param takes precedence.
	    Requires HTML::OSM >= 0.12.
	- GET /map: Nominatim live-search box is now suppressed (search => 0
	  passed to HTML::OSM).  The Reset Map button is retained; only the
	  search input and Nominatim egress are removed.  Requires HTML::OSM >=
	  0.12.

Changes  view on Meta::CPAN

      name.
    - Added a "Copy link" button to the filter toolbar.  The button
      appears only when at least one filter is active and copies the
      current URL (including all ?f= parameters) to the clipboard, so
      users can bookmark or share a custom-filtered view.  Uses the
      modern Clipboard API with an execCommand fallback for plain-HTTP
      deployments.  Clicking briefly shows "Copied!" feedback before
      reverting to the original label.

    [ Tests ]
    - Transaction 33: full TSV lifecycle (view, open, filter, export,
      upload).
    - Transaction 34: full .sqlite3 lifecycle (open, filter, export,
      browse, idempotency, table-name mismatch auto-correction).
    - Transaction 35: full .sqlite lifecycle (same phases as T34).
    - Transaction 37: heatmap chart lifecycle (val mode, count mode, 400
      for missing/invalid params, idempotency, toolbar button and panel
      presence).
    - Transaction 36: copy-link button lifecycle (absent without filters,
      present with one or more filters, JS clipboard paths present, CSS
      classes defined).
    - Transaction 39: remote file path (/../hostname/dir/file.ext)
      lifecycle (path parsing, hostname validation, extension guard,
      /open rendering, /api/columns spec resolution, idempotency,
      non-standard extension via _sniff_data_ext content detection,
      user@hostname credential passing).
      Net::SFTP::Foreign is stubbed in tests so no real SSH connection
      is required.
    - basic.t: added "GET /heatmap" smoke subtest, "SQLite3 format
      (.sqlite3 extension)" subtest, and "SQLite format (.sqlite
      extension)" subtest.

0.007.0	Wed Sep 16 07:33:53 PM EDT 2026
    [ Enhancements ]
    - Added pie chart support via the new GET /pie route.  A "Pie chart..."
      toolbar button opens a panel where the user chooses "Slice by" (the
      category column to group by) and "Sum of" (the numeric column to
      aggregate), plus an optional "Donut" toggle.  The controller sums each
      category using the same accounting-notation handling as the line graph,
      then delegates rendering to HTML::D3 0.14's new render_pie_chart_snippet
      (animated, sorted by value, capped at 12 slices with an "Other" tail,
      legend enabled).  HTML::D3 minimum bumped from 0.13 to 0.14.
    - Pie and line graph pages now show a two-level breadcrumb
      ("Home > Back to table") matching the dashboard style.
    - The table view now has a quick-filter bar below the toolbar.  A column
      select, operator select (equals, not equals, contains, starts with, less
      than, less or equal, greater than, greater or equal, is empty, is not
      empty), and a value input let the user add a filter condition without
      opening the "Merge data" panel.  Pressing Enter in the value field
      triggers Apply.  Active filter chips now each have an individual x-remove
      button to drop a single condition without clearing all filters.
    [ Bug Fixes ]
    - Opening the line graph panel after the pie chart panel (or vice versa)
      now correctly hides the previously open panel.  The graph panel's
      otherPanels list was missing 'pie-panel'.

0.006.0	Tue Sep 15 08:03:20 PM EDT 2026
    [ Enhancements ]
    - Added a 'home' link on the table display page
    - XLSX files are now supported directly via DBD::Excel (each worksheet
      is a separate table).  The upload endpoint, filesystem browser, and
      drag-and-drop drop zone all accept .xlsx files.  DBD::Excel added to
      TEST_REQUIRES.
    - "Combine data" now allows a file to be drag and dropped
    - Multi-table left joins are now delegated to Database::Join (>= 0.003.0)
      instead of the bespoke _left_join helper.  Column collision handling
      (prefixing right-table columns with "label.col" when a name clashes) is
      provided by Database::Join's new collision_prefix parameter.
      DataSource now exposes selectall_arrayref() and an improved columns()
      fallback so that DataSource objects can be passed directly to
      Database::Join as component databases.
    - Database::Join added to PREREQ_PM (runtime dependency).
    - DataSource::new now silently sanitizes table names derived from filenames:
      characters that are illegal in SQL identifiers (hyphens, dots, spaces,
      etc.) are replaced with underscores, and a digit-leading stem is prefixed
      with '_'.  The original filename stem is kept as the dbname so
      Database::Abstraction still locates the correct file on disk.  This means
      files like "Transactions-2026-09-08.csv" and "1data.csv" can now be
      opened via /open without error.  Only path-separator characters ('/', '\',
      NUL) and the empty string continue to croak error_table_name_invalid.
    - A "Totals" checkbox in the toolbar appends a summary row to the bottom of
      any data table.  When checked, every column whose values are all numeric
      (using the same parseAccounting logic as the sort and graph features, so
      accounting-notation negatives are handled correctly) shows its sum; date
      columns (YYYY-MM-DD, M/D/YYYY) are excluded from totalling even though
      parseFloat can extract a number from them.  Non-numeric columns are left
      blank.  The checkbox state is persisted in localStorage alongside column
      order and sort direction, so the totals row reappears automatically on
      page reload.  The summary row follows column drag-to-reorder automatically
      because moveCol() operates on all table rows including tfoot.
    - CSV and PSV files with no header row are now handled automatically.
      When every value in the first line fails the safe-identifier check,
      _detect_file_info tests whether any value looks like a date (YYYY-MM-DD,
      M/D/YYYY) or a signed/accounting-notation number.  If so, the file is
      treated as header-less: all rows (including the first) are read directly
      and column names are synthesised from the inferred data types -- date
      values become "Date", numeric/currency values become "Amount", and free
      text becomes "Description".  Duplicate types are disambiguated with a
      numeric suffix (Date2, Amount2, ...).  This allows bank and accounting
      exports such as "Transactions-current.csv" to open without error or any
      manual renaming of headers.
    - CHI in-process caching is now active for all data sources.  URL-backed
      tables (fetched via LWP from a remote web page) are cached for 15 minutes
      using a TTL-based key, so repeated visits to the same /import URL avoid
      a network round-trip on every page load.  File-backed tables are cached
      using a key that encodes the file's mtime, so a changed file naturally
      produces a cache miss without any explicit invalidation -- the stale entry
      is orphaned and reclaimed when the process restarts or the CHI Memory
      driver's GC runs.  The cache TTL and driver can be overridden in
      database_bi.conf via the "cache" key: { driver => 'File', ttl_url => '5 min' }.
      CHI added to PREREQ_PM and cpanfile.
    - DataSource::columns() now returns undef for URL-backed tables instead of
      delegating to Database::Abstraction's columns().  D::A fetches URL data
      lazily (in _open(), not in new()), so calling _db->columns() after a CHI
      cache hit (which bypasses _open()) would trigger an unexpected live network
      request -- failing with a non-200 error even when valid cached data was
      available.  Returning undef lets _get_columns derive column names from the
      cached data records, which is correct since URL/HTML tables have no
      canonical column order anyway.
    - Rows and columns can now be selected and deleted in the virtual table view.
      A checkbox column is injected at the left edge of every data table;
      clicking a row's checkbox selects it (turning the row pink) and Ctrl+click
      on any column header selects the column (highlighting all its cells in red).
      A "Delete selected" button appears in the toolbar as soon as any rows or
      columns are selected; clicking it removes them from the in-browser view
      without touching the underlying file.  Row selection supports a
      select-all/deselect-all checkbox in the header.  The record count in the
      toolbar is updated after deletion.  Sorting, drag-to-reorder, and the
      Totals row all continue to work correctly after deletions.
    - Line graphs now animate on initial page load (requires HTML::D3 >= 0.13).
      The line draws left-to-right via a stroke-dashoffset transition (1200 ms,
      easeLinear); data-point circles fade in after the line finishes (300 ms
      fade, 1200 ms delay).  Zoom and reset redraws are not animated -- a
      per-page initialDrawDone flag ensures the effect fires only once.
      When the viewer's OS has prefers-reduced-motion enabled the animation
      is skipped entirely and the chart appears instantly.
      HTML::D3 minimum version bumped to 0.13 in PREREQ_PM and cpanfile.

    [ Bug Fixes ]
    - When attempting to drag and drop a file larger than MAX_UPLOAD_BYTES,
      a better error message is displayed which stays on the screen for
      3 seconds
    - CSV and PSV files whose first line is blank (e.g. a file containing only
      a single newline character) are now treated as empty files rather than
      croaking "no column with a safe identifier name".  _detect_file_info now
      returns the _file_is_empty sentinel when the parsed first line yields
      zero column names, causing _init_backend to skip Database::Abstraction
      entirely and fetch_all to return [].  The /open endpoint renders the
      standard empty-table view ("No records found") instead of an error page.
      Tests added to t/edge_cases.t.
    - Files whose names contain spaces (e.g. "transactions for Nigel.xlsx")
      now open correctly.  Database::Abstraction validates its dbname argument
      as a SQL identifier and rejected names with spaces with an "unsafe dbname"
      error at fetch time.  DataSource::_init_backend now creates a temporary
      directory with a symlink using the sanitized name whenever the raw
      filename stem contains illegal SQL characters, so D::A sees only the
      safe name.  Regression test added as Transaction 27.
    - The "Line graph..." toolbar button was silently broken: clicking it did
      nothing.  buildYSelect() referenced SEL from the table-management IIFE
      where it was declared, but the graph-panel IIFE lives in a separate
      <script> block and cannot access that scope.  The ReferenceError thrown
      during initGraphBtn() prevented the click listener from ever being
      registered.  Fixed by removing the cross-IIFE reference entirely:
      buildYSelect() now uses r.cells[idx] instead of r.cells[idx + SEL],
      because Array.from(tHead.rows[0].cells) already includes the injected
      sel-th at position 0, so both the header and data arrays are shifted
      identically and no additional offset is needed.  A regression test in
      Transaction 22 verifies that buildYSelect does not reintroduce
      the idx+SEL double-offset.
    - The Y-axis dropdown in the "Line graph..." panel was listing non-numeric
      columns (e.g. Description) as valid Y-axis choices, and omitting the
      correct numeric ones (e.g. Balance).  Root cause: buildYSelect() used
      r.cells[idx + SEL] where idx came from headers.forEach() over
      tHead.rows[0].cells.  Because injectSelCol shifts both thead (sel-th)
      and tbody (checkbox) by one position, the header and data arrays are
      already aligned; adding SEL read one cell to the right of the header
      under test, causing every column's numeric check to be evaluated against
      the data of the column to its right.  Fix: changed to r.cells[idx].
    - Spreadsheet::ParseXLSX added to PREREQ_PM.  DBD::Excel 0.07 only
      handles .xls (its source skips .xlsx files entirely); DataSource now
      reads .xlsx directly via Spreadsheet::ParseXLSX in _detect_file_info,
      bypassing D::A the same way headerless CSV files do.
      Excel::Writer::XLSX added to TEST_REQUIRES for fixture creation.
      Transaction 28 covers XLSX open lifecycle including spaced filenames.
    - Synthesised column headers for header-less CSV/PSV files are now
      capitalised (Date, Amount, Description) so they display correctly as
      table headers in the browser.
    - Berkeley DB files (.db extension) can now be opened via /view/:table,
      /open, and the filesystem browser.  Database::Abstraction detects the
      BerkeleyDB magic bytes automatically and opens the file via DB_File
      (a Perl core module).  No code change was required in Database::BI;
      the existing @SUPPORTED_EXT and _detect_file_info already handled .db
      files correctly.  Transaction 29 confirms the end-to-end lifecycle.

0.005.2 Fri Sep 11 06:08:10 AM EDT 2026
    [ Bug Fixes ]
    - Fixed SIGABRT crash (DBI XS assertion failure) in t/edge_cases.t on
      DEBUGGING-enabled perls (observed: perl 5.44.0 + DBI 1.651 + DBD::CSV
      0.64).  When a 0-byte CSV file was opened, _detect_file_info returned
      the generic "not CSV" sentinel ({}), causing _init_backend to create a
      Database::Abstraction object without the max_slurp_size guard.  D::A
      fell back to the DBD::CSV path, which issued "SELECT * FROM <table>" on
      an empty file; DBD::CSV's EOF error left DBI's internal Errstr SV in a
      shape that violated an XS assertion, crashing the process during global
      destruction after all test assertions had already passed (so the TAP
      plan was never written and the harness reported FAIL).
      Fix: _detect_file_info now returns { _file_is_empty => 1, file_size => 0 }
      for 0-byte files.  _init_backend detects this sentinel and short-circuits



( run in 1.453 second using v1.01-cache-2.11-cpan-eb134014566 )